PowerPC64 DT_RELR relative reloc addresses
authorAlan Modra <amodra@gmail.com>
Wed, 2 Mar 2022 13:34:57 +0000 (00:04 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 3 Mar 2022 02:17:40 +0000 (12:47 +1030)
commit0aac2413d39d9f6d9e6879a0daa6bd5dea3e0fe3
tree013739637c9c651afbdbb9fbfedf77cd12bb0935
parenta8dc389afe1d86220633f7bc10983efe85e34541
PowerPC64 DT_RELR relative reloc addresses

Section addresses can change between ppc64_elf_size_stubs and
ppc64_elf_build_stubs due to .eh_frame editing.  The idea of stashing
r_offset final addresses calculated in ppc64_elf_size_stubs for use by
ppc64_elf_build_stubs was never a good idea.  Instead, we need to keep
section/offset pairs.

* elf64-ppc.c (struct ppc_link_hash_table): Delete relr_addr.
Add relr section/offset array.
(append_relr_off): Rewrite.  Update all callers.
(sort_relr): New function.
(ppc64_elf_size_stubs): Adjust to suit new relative reloc stash.
(ppc64_elf_build_stubs): Likewise.
bfd/elf64-ppc.c