diff options
author | Alan Modra <amodra@gmail.com> | 2016-12-03 21:00:01 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2016-12-03 21:00:01 +1030 |
commit | 8c5b4e5228ec94923fbdfb0008926b0b2a3f51c2 (patch) | |
tree | 609d1d4f5f5f0db079c91b00c8806f818e419076 /bfd/elf64-ppc.h | |
parent | 4e95fbcd79b84308417fc25ce12cacdb2a61c0d0 (diff) | |
download | gdb-8c5b4e5228ec94923fbdfb0008926b0b2a3f51c2.zip gdb-8c5b4e5228ec94923fbdfb0008926b0b2a3f51c2.tar.gz gdb-8c5b4e5228ec94923fbdfb0008926b0b2a3f51c2.tar.bz2 |
PowerPC64 dot-symbol compatibility bugfixes
Lots of fixes for the compatibility code that handles linking of
-mcall-aixdesc code (or that generated by 12 year old gcc) with
current ELFv1 ABI code.
1) A reference to a dot-symbol in an object file wasn't satisfied by a
function descriptor in later object files.
2) The as-needed code had bit-rotted; Shared libs now need a strong
reference to be counted as needed.
3) --gc-sections involving dot-symbols was broken, needing
func_desc_adjust to be run early and lots of other fixes.
bfd/
* elf64-ppc.c (struct ppc_link_hash_entry): Delete "was_undefined".
(struct ppc_link_hash_table): Delete "twiddled_syms". Add
"need_func_desc_adj".
(lookup_fdh): Link direct fdh sym via oh field and set flags.
(make_fdh): Make strong and weak undefined function descriptor
symbols.
(ppc64_elf_merge_symbol): New function.
(elf_backend_merge_symbol): Define.
(ppc64_elf_archive_symbol_lookup): Don't test undefweak for fake
function descriptors.
(add_symbol_adjust): Don't twiddle symbols to undefweak.
Propagate more ref flags to function descriptor symbol. Make
some function descriptor symbols dynamic.
(ppc64_elf_before_check_relocs): Only run add_symbol_adjust for
ELFv1. Set need_func_desc_adj. Don't fix undefs list.
(ppc64_elf_check_relocs): Set non_ir_ref for descriptors.
Don't call lookup_fdh here.
(ppc64_elf_gc_sections): New function.
(bfd_elf64_bfd_gc_sections): Define.
(ppc64_elf_gc_mark_hook): Mark descriptor.
(func_desc_adjust): Don't make fake function descriptor syms strong
here. Exit earlier on non-dotsyms. Take note of elf.dynamic
flag when deciding whether a dynamic function descriptor might
be needed. Transfer elf.dynamic and set elf.needs_plt. Move
plt regardless of visibility. Make descriptor dynamic if
entry sym is dynamic, not for other cases.
(ppc64_elf_func_desc_adjust): Don't run func_desc_adjust if
already done.
(ppc64_elf_edit_opd): Use oh field rather than lookup_fdh.
(ppc64_elf_size_stubs): Likewise.
(ppc_build_one_stub): Don't clear was_undefined. Only set sym
undefweak if stub symbol is defined.
(undo_symbol_twiddle, ppc64_elf_restore_symbols): Delete.
* elf64-ppc.h (ppc64_elf_restore_symbols): Don't declare.
ld/
* emultempl/ppc64elf.em (gld${EMULATION_NAME}_finish): Don't call
ppc64_elf_restore_symbols.
* testsuite/ld-powerpc/dotsym1.d: New.
* testsuite/ld-powerpc/dotsym2.d: New.
* testsuite/ld-powerpc/dotsym3.d: New.
* testsuite/ld-powerpc/dotsym4.d: New.
* testsuite/ld-powerpc/dotsymref.s: New.
* testsuite/ld-powerpc/nodotsym.s: New.
* testsuite/ld-powerpc/powerpc.exp: Run new tests.
Diffstat (limited to 'bfd/elf64-ppc.h')
-rw-r--r-- | bfd/elf64-ppc.h | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/bfd/elf64-ppc.h b/bfd/elf64-ppc.h index 971ba09..b1ea550 100644 --- a/bfd/elf64-ppc.h +++ b/bfd/elf64-ppc.h @@ -94,5 +94,3 @@ bfd_boolean ppc64_elf_size_stubs (struct bfd_link_info *); bfd_boolean ppc64_elf_build_stubs (struct bfd_link_info *, char **); -void ppc64_elf_restore_symbols - (struct bfd_link_info *info); |