Adjust the .bss alignment to include common symbols.

llvm-svn: 262840
This commit is contained in:
Rafael Espindola 2016-03-07 17:43:39 +00:00
parent 81113ef68c
commit e711fc3767
2 changed files with 4 additions and 0 deletions

View File

@ -722,6 +722,7 @@ void Writer<ELFT>::addCommonSymbols(std::vector<DefinedCommon *> &Syms) {
uintX_t Off = getBss()->getSize();
for (DefinedCommon *C : Syms) {
Off = alignTo(Off, C->MaxAlignment);
Out<ELFT>::Bss->updateAlign(C->MaxAlignment);
C->OffsetInBss = Off;
Off += C->Size;
}

View File

@ -13,6 +13,9 @@
// CHECK-NEXT: Address: 0x11000
// CHECK-NEXT: Offset:
// CHECK-NEXT: Size: 22
// CHECK-NEXT: Link: 0
// CHECK-NEXT: Info: 0
// CHECK-NEXT: AddressAlignment: 16
// CHECK: Name: sym1
// CHECK-NEXT: Value: 0x11004