diff options
author | Alan Modra <amodra@gmail.com> | 2022-06-25 11:57:22 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-06-27 12:28:59 +0930 |
commit | 0d8fb090a7d51c79095983e22b097ba1e6eeb17b (patch) | |
tree | b09ffa4947a18220badd00c5ac542d0e93959898 /ld/emulparams | |
parent | 648f6099d4dcadf446f3f00790ad4b16dd4042f6 (diff) | |
download | binutils-0d8fb090a7d51c79095983e22b097ba1e6eeb17b.zip binutils-0d8fb090a7d51c79095983e22b097ba1e6eeb17b.tar.gz binutils-0d8fb090a7d51c79095983e22b097ba1e6eeb17b.tar.bz2 |
PowerPC64 .branch_lt address
.branch_lt is really an extension of .plt, as is .iplt. We'd like all
of the PLT sections to be fixed relative to .TOC. after stub sizing,
because changes in offset to PLT entries might mean a change in stub
sizes. When -z relro, the relro layout does this by laying out
sections from the end of the relro segment. So for example, a change
in .eh_frame (which happens after stub sizing) will keep the same GOT
to PLT offset when -z relro. Not so when -z norelro, because then the
usual forward layout of section is done and .got is more aligned than
.branch_lt.
* emulparams/elf64ppc.sh: Set .branch_lt address fixed relative
to .got.
* testsuite/ld-powerpc/elfv2exe.d: Adjust to suit.
Diffstat (limited to 'ld/emulparams')
-rw-r--r-- | ld/emulparams/elf64ppc.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ld/emulparams/elf64ppc.sh b/ld/emulparams/elf64ppc.sh index a18393b..59132fa 100644 --- a/ld/emulparams/elf64ppc.sh +++ b/ld/emulparams/elf64ppc.sh @@ -37,7 +37,7 @@ OTHER_GOT_RELOC_SECTIONS=" OTHER_RELRO_SECTIONS_2=" .opd ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { KEEP (*(.opd)) } .toc1 ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.toc1) } - .branch_lt ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.branch_lt) }" + .branch_lt ${RELOCATING-0}${RELOCATING+(SIZEOF(.got) != 0 ? . + 255 - (255 & (. - 1 + ALIGN(SIZEOF(.branch_lt),8)${RELRO_NOW+ + ALIGN(SIZEOF(.plt),8) + ALIGN(SIZEOF(.iplt),8)})) : ALIGN(8))} : { *(.branch_lt) }" INITIAL_READWRITE_SECTIONS=" .toc ${RELOCATING-0} :${RELOCATING+ ALIGN(8)} { *(.toc) }" # Put .got before .data |