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 /ld/testsuite/ld-powerpc/powerpc.exp | |
parent | PowerPC64 dot-sym testsuite fixes (diff) | |
download | binutils-gdb-8c5b4e5228ec94923fbdfb0008926b0b2a3f51c2.tar.gz binutils-gdb-8c5b4e5228ec94923fbdfb0008926b0b2a3f51c2.tar.bz2 binutils-gdb-8c5b4e5228ec94923fbdfb0008926b0b2a3f51c2.zip |
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 'ld/testsuite/ld-powerpc/powerpc.exp')
-rw-r--r-- | ld/testsuite/ld-powerpc/powerpc.exp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ld/testsuite/ld-powerpc/powerpc.exp b/ld/testsuite/ld-powerpc/powerpc.exp index 07226c63c40..18a8e62c052 100644 --- a/ld/testsuite/ld-powerpc/powerpc.exp +++ b/ld/testsuite/ld-powerpc/powerpc.exp @@ -299,6 +299,10 @@ if [ supports_ppc64 ] then { run_dump_test "tlsld" run_dump_test "relocsort" run_dump_test "addpcis" + run_dump_test "dotsym1" + run_dump_test "dotsym2" + run_dump_test "dotsym3" + run_dump_test "dotsym4" } run_dump_test "tlsld32" |