[lld] r323172 - Use 4 as the alignment of .eh_frame_hdr.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 22 21:23:24 PST 2018
Author: rafael
Date: Mon Jan 22 21:23:23 2018
New Revision: 323172
URL: http://llvm.org/viewvc/llvm-project?rev=323172&view=rev
Log:
Use 4 as the alignment of .eh_frame_hdr.
It includes 32 bit values and this matches both gold and bfd.
Modified:
lld/trunk/ELF/SyntheticSections.cpp
lld/trunk/test/ELF/eh-frame-hdr.s
Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=323172&r1=323171&r2=323172&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Mon Jan 22 21:23:23 2018
@@ -2173,7 +2173,7 @@ void GdbIndexSection::writeTo(uint8_t *B
bool GdbIndexSection::empty() const { return !Out::DebugInfo; }
EhFrameHeader::EhFrameHeader()
- : SyntheticSection(SHF_ALLOC, SHT_PROGBITS, 1, ".eh_frame_hdr") {}
+ : SyntheticSection(SHF_ALLOC, SHT_PROGBITS, 4, ".eh_frame_hdr") {}
// .eh_frame_hdr contains a binary search table of pointers to FDEs.
// Each entry of the search table consists of two values,
Modified: lld/trunk/test/ELF/eh-frame-hdr.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/eh-frame-hdr.s?rev=323172&r1=323171&r2=323172&view=diff
==============================================================================
--- lld/trunk/test/ELF/eh-frame-hdr.s (original)
+++ lld/trunk/test/ELF/eh-frame-hdr.s Mon Jan 22 21:23:23 2018
@@ -60,7 +60,7 @@ _start:
// HDR-NEXT: Size: 36
// HDR-NEXT: Link: 0
// HDR-NEXT: Info: 0
-// HDR-NEXT: AddressAlignment: 1
+// HDR-NEXT: AddressAlignment: 4
// HDR-NEXT: EntrySize: 0
// HDR-NEXT: SectionData (
// HDR-NEXT: 0000: 011B033B 24000000 03000000 A80E0000
@@ -130,5 +130,5 @@ _start:
// HDR-NEXT: Flags [
// HDR-NEXT: PF_R
// HDR-NEXT: ]
-// HDR-NEXT: Alignment: 1
+// HDR-NEXT: Alignment: 4
// HDR-NEXT: }
More information about the llvm-commits
mailing list