aboutsummaryrefslogtreecommitdiff
path: root/binutils/nm.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-10-31 18:13:03 +1030
committerAlan Modra <amodra@gmail.com>2017-11-05 09:37:33 +1030
commit127e8e9f62ed0e7145dfa1172c6253275fc150dd (patch)
treedef30853228eab94412a04c0a3a4d6182b6518b9 /binutils/nm.c
parentab4b1c4699fecd1f2461cecae108e7c583c15bc4 (diff)
downloadgdb-127e8e9f62ed0e7145dfa1172c6253275fc150dd.zip
gdb-127e8e9f62ed0e7145dfa1172c6253275fc150dd.tar.gz
gdb-127e8e9f62ed0e7145dfa1172c6253275fc150dd.tar.bz2
PR22394, hppa-linux-ld fails to emit dynamic relocations
gcc -mfast-indirect-calls emits a function pointer initialization without a P% (plabel) modifier. ld does not create the necessary dynamic relocations for this to work. It turns out that the problem is caused by the non_got_ref symbol flag. This flag is set for non-pic by check_relocs to indicate that the symbol might need copy relocations or dynamic relocations. Later, the backend adjust_dynamic_symbol clears the flag to indicate dynamic relocations are needed, but leaves it set when copy relocations were created. The inversion in meaning is insane, but it's that way because the backend adjust_dynamic_symbol function doesn't get to look at all symbols.. Anyway, the insanity works for non-function symbols. However, the flag is left set on any function symbol with a dynamic relocation. This patch fixes the non_got_ref handling for function symbols, adds -z nocopyreloc for hppa-elf, reports where textrel occurs, and expands comments. The check_relocs change just stops creation of dyn_relocs we always threw away later. PR 22394 * elf32-hppa.c (elf32_hppa_check_relocs): Don't create dyn_relocs for plabels when non-pic. (maybe_set_textrel): New function. (readonly_dynrelocs): Move and rewrite. (elf32_hppa_adjust_dynamic_symbol): Use it. Don't create copy relocs when def_regular or -z nocopyreloc. Handle non_got_ref for functions. Expand non_got_ref comments. (elf32_hppa_size_dynamic_sections): Use maybe_set_textrel.
Diffstat (limited to 'binutils/nm.c')
0 files changed, 0 insertions, 0 deletions