forked from OSchip/llvm-project
Fix the alignment of PT_PHDR.
We were claiming it was aligned to 8 bytes even on 32 bit files, which is not the case. llvm-svn: 260102
This commit is contained in:
parent
529c27f408
commit
a64f7d1148
|
@ -1187,7 +1187,8 @@ template <class ELFT> void Writer<ELFT>::assignAddresses() {
|
|||
size_t PhdrSize = sizeof(Elf_Phdr) * Phdrs.size();
|
||||
|
||||
// The first phdr entry is PT_PHDR which describes the program header itself.
|
||||
setPhdr(&Phdrs[0], PT_PHDR, PF_R, FileOff, VA, PhdrSize, /*Align=*/8);
|
||||
setPhdr(&Phdrs[0], PT_PHDR, PF_R, FileOff, VA, PhdrSize,
|
||||
/*Align=*/sizeof(uintX_t));
|
||||
FileOff += PhdrSize;
|
||||
VA += PhdrSize;
|
||||
|
||||
|
|
|
@ -216,7 +216,7 @@ __start:
|
|||
# CHECK-NEXT: Flags [ (0x4)
|
||||
# CHECK-NEXT: PF_R (0x4)
|
||||
# CHECK-NEXT: ]
|
||||
# CHECK-NEXT: Alignment: 8
|
||||
# CHECK-NEXT: Alignment: 4
|
||||
# CHECK-NEXT: }
|
||||
# CHECK-NEXT: ProgramHeader {
|
||||
# CHECK-NEXT: Type: PT_LOAD (0x1)
|
||||
|
|
|
@ -215,7 +215,7 @@
|
|||
// CHECK-NEXT: Flags [ (0x4)
|
||||
// CHECK-NEXT: PF_R (0x4)
|
||||
// CHECK-NEXT: ]
|
||||
// CHECK-NEXT: Alignment: 8
|
||||
// CHECK-NEXT: Alignment: 4
|
||||
// CHECK-NEXT: }
|
||||
// CHECK-NEXT: ProgramHeader {
|
||||
// CHECK-NEXT: Type: PT_LOAD (0x1)
|
||||
|
|
|
@ -120,7 +120,7 @@ _start:
|
|||
# CHECK-NEXT: Flags [ (0x4)
|
||||
# CHECK-NEXT: PF_R (0x4)
|
||||
# CHECK-NEXT: ]
|
||||
# CHECK-NEXT: Alignment: 8
|
||||
# CHECK-NEXT: Alignment: 4
|
||||
# CHECK-NEXT: }
|
||||
# CHECK-NEXT: ProgramHeader {
|
||||
# CHECK-NEXT: Type: PT_LOAD (0x1)
|
||||
|
|
Loading…
Reference in New Issue