PowerPC32 treatment of absolute symbols
authorAlan Modra <amodra@gmail.com>
Wed, 30 Mar 2022 21:11:03 +0000 (07:41 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 4 May 2022 05:11:56 +0000 (14:41 +0930)
commit7a9361c00d53bb41c9ae331780226a99b9339920
tree54c42f93b44a60e8956f9b628a3af2072b8010bd
parent24ef0d41ac9632ff85d3781e5852371e39661558
PowerPC32 treatment of absolute symbols

As already done for PowerPC64, fix dynamic relocs for absolute symbols.
The patch also tidies the dynamic reloc handling code in check_relocs,
removing leftover comments and code from when check_relocs was called
as each object file was read in.

bfd/
* elf32-ppc.c (ppc_elf_check_relocs): Set isym and ifunc earlier.
Rearrange tests for dynamic relocs, handling absolute symbols.
(allocate_dynrelocs): Don't allocate dynamic relocs for locally
defined absolute symbols.
(ppc_elf_size_dynamic_sections): Similarly.
(ppc_elf_relocate_section): Similarly.
ld/
* testsuite/ld-powerpc/abs32-pie.d,
* testsuite/ld-powerpc/abs32-pie.r,
* testsuite/ld-powerpc/abs32-reloc.s,
* testsuite/ld-powerpc/abs32-shared.d,
* testsuite/ld-powerpc/abs32-shared.r,
* testsuite/ld-powerpc/abs32-static.d,
* testsuite/ld-powerpc/abs32-static.r: New tests.
* testsuite/ld-powerpc/powerpc.exp: Run them.
bfd/elf32-ppc.c
ld/testsuite/ld-powerpc/abs32-pie.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/abs32-pie.r [new file with mode: 0644]
ld/testsuite/ld-powerpc/abs32-reloc.s [new file with mode: 0644]
ld/testsuite/ld-powerpc/abs32-shared.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/abs32-shared.r [new file with mode: 0644]
ld/testsuite/ld-powerpc/abs32-static.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/abs32-static.r [new file with mode: 0644]
ld/testsuite/ld-powerpc/powerpc.exp