]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR25384, PowerPC64 ELFv1 copy relocs against function symbols
authorAlan Modra <amodra@gmail.com>
Tue, 14 Jan 2020 10:15:53 +0000 (20:45 +1030)
committerAlan Modra <amodra@gmail.com>
Wed, 15 Jan 2020 03:10:41 +0000 (13:40 +1030)
commitf5deb4103e0cec3912c304d7c08277aadab09e5c
tree894a7e3762fdcfdb1a1527d62ca34a28cb0222a9
parent1f656f70098a9acda9bdf4c047cb86fedc007206
PR25384, PowerPC64 ELFv1 copy relocs against function symbols

Function symbols of course don't normally want .dynbss copies but
with some old versions of gcc they are needed to copy the function
descriptor.  This patch restricts the cases where they are useful to
compilers using dot-symbols, and enables the warning regardless of
whether a PLT entry is emitted in the executable.  PLTs in shared
libraries are affected by a .dynbss copy in the executable.

bfd/
PR 25384
* elf64-ppc.c (ELIMINATE_COPY_RELOCS): Update comment.
(ppc64_elf_adjust_dynamic_symbol): Don't allow .dynbss copies
of function symbols unless dot symbols are present.  Do warn
whenever one is created, regardles of whether a PLT entry is
also emitted for the function symbol.
ld/
* testsuite/ld-powerpc/ambiguousv1b.d: Adjust expected output.
* testsuite/ld-powerpc/funref.s: Align func_tab.
* testsuite/ld-powerpc/funref2.s: Likewise.
* testsuite/ld-powerpc/funv1.s: Add dot symbols.

(cherry picked from commit e1c6cf618cbeebbafd34afc5ee921fcbf7061bfa)
bfd/ChangeLog
bfd/elf64-ppc.c
ld/ChangeLog
ld/testsuite/ld-powerpc/ambiguousv1b.d
ld/testsuite/ld-powerpc/funref.s
ld/testsuite/ld-powerpc/funref2.s
ld/testsuite/ld-powerpc/funv1.s