Taking an undefined function's address in an executable
authorAlan Modra <amodra@gmail.com>
Wed, 2 Jul 2014 05:37:18 +0000 (15:07 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 2 Jul 2014 08:46:14 +0000 (18:16 +0930)
commitd1eca1e41ddae8c3cd925be827640de919301432
tree94f81941bc024992334cec35ad62ad86418db131
parent9b11e3a7327f7b1fd5d40a6450a3cc323a78380c
Taking an undefined function's address in an executable

doesn't always mean you need to define a function symbol on plt code.
If all references are in read-write sections, then using dynamic relocs
is OK.

bfd/
* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Clear
pointer_equality_needed when !readonly_dynrelocs.
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise.
ld/testsuite/
* ld-powerpc/ambiguousv1.d: Match symbol table too.
* ld-powerpc/ambiguousv2.d: Likewise.
* ld-powerpc/ambiguousv1b.d: New.
* ld-powerpc/ambiguousv2b.d: New.
* ld-powerpc/powerpc.exp: Run new tests.
bfd/ChangeLog
bfd/elf32-ppc.c
bfd/elf64-ppc.c
ld/testsuite/ChangeLog
ld/testsuite/ld-powerpc/ambiguousv1.d
ld/testsuite/ld-powerpc/ambiguousv1b.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/ambiguousv2.d
ld/testsuite/ld-powerpc/ambiguousv2b.d [new file with mode: 0644]
ld/testsuite/ld-powerpc/funref2.s [new file with mode: 0644]
ld/testsuite/ld-powerpc/powerpc.exp