From 6b2b45020c4a84ef012e704f6dcdacc3c5923f33 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Tue, 23 Jan 2018 05:23:23 +0000 Subject: [PATCH] Use 4 as the alignment of .eh_frame_hdr. It includes 32 bit values and this matches both gold and bfd. llvm-svn: 323172 --- lld/ELF/SyntheticSections.cpp | 2 +- lld/test/ELF/eh-frame-hdr.s | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index 30c0cbb38e3d..0525bf064510 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -2173,7 +2173,7 @@ void GdbIndexSection::writeTo(uint8_t *Buf) { 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, diff --git a/lld/test/ELF/eh-frame-hdr.s b/lld/test/ELF/eh-frame-hdr.s index 4498d7d30eaa..aaeccda6eae4 100644 --- a/lld/test/ELF/eh-frame-hdr.s +++ b/lld/test/ELF/eh-frame-hdr.s @@ -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: }