]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - bfd/elf64-ppc.c
PowerPC64 dynamic symbol tweaks
authorAlan Modra <amodra@gmail.com>
Mon, 23 Sep 2019 06:36:22 +0000 (16:06 +0930)
committerAlan Modra <amodra@gmail.com>
Mon, 23 Sep 2019 14:19:25 +0000 (23:49 +0930)
commitec73ddcd43b588924c95f1a997351314ddf84e39
tree890a18f8399d1e10e473bd99bb1b6cf11d1fb804
parent6831670dd3c0a64e332b316c95873c57ab19887a
PowerPC64 dynamic symbol tweaks

In check_relocs, bfd_link_pic true means ld is producing a shared
library or a position independent executable.  !bfd_link_pic means a
fixed position (ie. static) executable since the relocatable linking
case is excluded.  So it is appropriate to continue using bfd_link_pic
when testing whether non-pcrelative relocations should be dynamic, and
!bfd_link_pic for the special case of ifunc in static executables.
However, -Bsymbolic shouldn't affect PIEs (they are executables so
none of their symbols should be overridden) and PIEs can support copy
relocations, thus bfd_link_executable should be used in those cases
rather than bfd_link_pic.

I've also removed the test of ELIMINATE_COPY_RELOCS in check_relocs.
We can sort out what to do regarding copy relocs later, which allows
the code in check_relocs to be simplified.

* elf64-ppc.c (ppc64_elf_check_relocs): Use bfd_link_executable
in choosing between different actions for shared library and
non-shared library cases.  Delete ELIMINATE_COPY_RELOCS test.
(dec_dynrel_count): Likewise.  Account for ifunc special case.
(ppc64_elf_adjust_dynamic_symbol): Copy relocs are for executables,
not non-pic.
(allocate_dynrelocs): Comment fixes.  Delete ELIMINATE_COPY_RELOCS
test.
bfd/ChangeLog
bfd/elf64-ppc.c