forked from OSchip/llvm-project
Fix the alignment of the section headers.
Thanks a lot to Rui for noticing it. llvm-svn: 244711
This commit is contained in:
parent
4ec3e13c91
commit
91009b3856
|
@ -185,6 +185,8 @@ template <class ELFT> void Writer<ELFT>::assignAddresses() {
|
|||
FileOff += StrTabBuilder.data().size();
|
||||
NumSections++;
|
||||
|
||||
FileOff += OffsetToAlignment(FileOff, ELFT::Is64Bits ? 8 : 4);
|
||||
|
||||
// Add space for section headers.
|
||||
SectionHeaderOff = FileOff;
|
||||
FileOff += NumSections * sizeof(Elf_Shdr_Impl<ELFT>);
|
||||
|
|
|
@ -25,7 +25,7 @@ _start:
|
|||
# CHECK-NEXT: Version: 1
|
||||
# CHECK-NEXT: Entry: 0x401000
|
||||
# CHECK-NEXT: ProgramHeaderOffset: 0x40
|
||||
# CHECK-NEXT: SectionHeaderOffset: 0x102A
|
||||
# CHECK-NEXT: SectionHeaderOffset: 0x1030
|
||||
# CHECK-NEXT: Flags [ (0x0)
|
||||
# CHECK-NEXT: ]
|
||||
# CHECK-NEXT: HeaderSize: 64
|
||||
|
|
|
@ -25,7 +25,7 @@ _start:
|
|||
# CHECK-NEXT: Version: 1
|
||||
# CHECK-NEXT: Entry: 0x401000
|
||||
# CHECK-NEXT: ProgramHeaderOffset: 0x34
|
||||
# CHECK-NEXT: SectionHeaderOffset: 0x102A
|
||||
# CHECK-NEXT: SectionHeaderOffset: 0x102C
|
||||
# CHECK-NEXT: Flags [ (0x0)
|
||||
# CHECK-NEXT: ]
|
||||
# CHECK-NEXT: HeaderSize: 52
|
||||
|
|
|
@ -25,7 +25,7 @@ _start:
|
|||
# CHECK-NEXT: Version: 1
|
||||
# CHECK-NEXT: Entry: 0x401000
|
||||
# CHECK-NEXT: ProgramHeaderOffset: 0x34
|
||||
# CHECK-NEXT: SectionHeaderOffset: 0x102A
|
||||
# CHECK-NEXT: SectionHeaderOffset: 0x102C
|
||||
# CHECK-NEXT: Flags [ (0x0)
|
||||
# CHECK-NEXT: ]
|
||||
# CHECK-NEXT: HeaderSize: 52
|
||||
|
|
|
@ -30,7 +30,7 @@ _start:
|
|||
# CHECK-NEXT: Version: 1
|
||||
# CHECK-NEXT: Entry: 0x401000
|
||||
# CHECK-NEXT: ProgramHeaderOffset: 0x40
|
||||
# CHECK-NEXT: SectionHeaderOffset: 0x1047
|
||||
# CHECK-NEXT: SectionHeaderOffset: 0x1048
|
||||
# CHECK-NEXT: Flags [ (0x0)
|
||||
# CHECK-NEXT: ]
|
||||
# CHECK-NEXT: HeaderSize: 64
|
||||
|
|
Loading…
Reference in New Issue