diff options
author | Alan Modra <amodra@gmail.com> | 2018-04-09 09:21:59 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2018-04-09 17:02:19 +0930 |
commit | 49c09209d06885dc8350042ce77e442bfbb5bf27 (patch) | |
tree | 8acffc57915285f2c28394f16c3bfa1a7bf075f6 /ld | |
parent | 08be322439408ac02cff2ac9b5eca4f7243a0277 (diff) | |
download | gdb-49c09209d06885dc8350042ce77e442bfbb5bf27.zip gdb-49c09209d06885dc8350042ce77e442bfbb5bf27.tar.gz gdb-49c09209d06885dc8350042ce77e442bfbb5bf27.tar.bz2 |
Rearrange PLT reloc output on powerpc
The current scheme where we output PLT relocs for global symbols in
finish_dynamic_symbol, and PLT relocs for local symbols when
outputting stubs does not work if PLT entries are to be used for
inline PLT sequences against non-dynamic globals or local symbols.
bfd/
* elf64-ppc.c (ppc_build_one_stub): Move output of PLT relocs
for local symbols to..
(write_plt_relocs_for_local_syms): ..here. New function.
(ppc64_elf_finish_dynamic_symbol): Move output of PLT relocs for
global symbols to..
(build_global_entry_stubs_and_plt): ..here. Rename from
build_global_entry_stubs.
(ppc64_elf_build_stubs): Always call build_global_entry_stubs_and_plt.
Call write_plt_relocs_for_local_syms.
* elf32-ppc.c (get_sym_h): New function.
(ppc_elf_relax_section): Use get_sym_h.
(ppc_elf_relocate_section): Move output of PLT relocs and glink
stubs for local symbols to..
(ppc_finish_symbols): ..here. New function.
(ppc_elf_finish_dynamic_symbol): Move output of PLT relocs for
global syms to..
(write_global_sym_plt): ..here. New function.
* elf32-ppc.h (ppc_elf_modify_segment_map): Delete attribute.
(ppc_finish_symbols): Declare.
ld/
* ppc32elf.em (ppc_finish): Call ppc_finish_symbols.
Diffstat (limited to 'ld')
-rw-r--r-- | ld/ChangeLog | 4 | ||||
-rw-r--r-- | ld/emultempl/ppc32elf.em | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog index b2fd135..4e697a3 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,7 @@ +2018-04-09 Alan Modra <amodra@gmail.com> + + * ppc32elf.em (ppc_finish): Call ppc_finish_symbols. + 2018-04-05 H.J. Lu <hongjiu.lu@intel.com> PR gas/22318 diff --git a/ld/emultempl/ppc32elf.em b/ld/emultempl/ppc32elf.em index 3c335b7..05a2894 100644 --- a/ld/emultempl/ppc32elf.em +++ b/ld/emultempl/ppc32elf.em @@ -212,6 +212,8 @@ ppc_finish (void) { if (params.ppc476_workaround) lang_for_each_statement (no_zero_padding); + if (!ppc_finish_symbols (&link_info)) + einfo (_("%X%P: ppc_finish_symbols problem %E\n")); finish_default (); } |