binutils-gdb/ld/emultempl
Alan Modra 8c5b4e5228 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.
2016-12-03 21:00:01 +10:30
..
README Copyright update for binutils 2016-01-01 23:00:01 +10:30
aarch64elf.em Enable relro by default for AArch64, ARM and SCORE. 2016-08-19 09:27:52 +01:00
aix.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
alphaelf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
arclinux.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
armcoff.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
armelf.em Reduce parameter list in bfd_elf32_arm_target_relocs 2016-08-26 14:00:39 +01:00
astring.sed
avrelf.em Fix spelling in comments in .em files (ld) 2016-11-27 15:09:50 +10:30
beos.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
bfin.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
cr16elf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
crxelf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
elf-generic.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
elf32.em Fix seg-fault linking corrupt binary. 2016-12-02 14:40:46 +00:00
epiphanyelf_4x4.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
genelf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
generic.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
gld960.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
gld960c.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
hppaelf.em [HPPA] Attach linker created dynamic sections to stub bfd 2016-05-11 22:51:14 +09:30
ia64elf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
irix.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
linux.em Enable relro by default for AArch64, ARM and SCORE. 2016-08-19 09:27:52 +01:00
lnk960.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
m68hc1xelf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
m68kcoff.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
m68kelf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
metagelf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
mipself.em MIPS/LD: Convert ELF linker emulation option macros to an enum 2016-01-04 23:35:03 +00:00
mmix-elfnmmo.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
mmixelf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
mmo.em Speedup mmo and pe orphan placement for relocatable link 2016-03-02 05:07:50 -08:00
msp430.em Remove use of alloca. 2016-03-21 16:31:46 +00:00
nds32elf.em Don't include libbfd.h outside of bfd, part 1 2016-07-16 13:25:11 +09:30
needrelax.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
netbsd.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
nios2elf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
ostring.sed
pe.em Fix spelling in comments in .em files (ld) 2016-11-27 15:09:50 +10:30
pep.em Fix spelling in comments in .em files (ld) 2016-11-27 15:09:50 +10:30
ppc32elf.em PR20744, Incorrect PowerPC VLE relocs 2016-11-22 20:19:29 +10:30
ppc64elf.em PowerPC64 dot-symbol compatibility bugfixes 2016-12-03 21:00:01 +10:30
riscvelf.em Add support for RISC-V architecture. 2016-11-01 16:45:57 +00:00
rxelf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
scoreelf.em Enable relro by default for AArch64, ARM and SCORE. 2016-08-19 09:27:52 +01:00
sh64elf.em Don't include libbfd.h outside of bfd, part 1 2016-07-16 13:25:11 +09:30
solaris2.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
spu_icache.S
spu_icache.o_c Regenerate spu overlay and icache manager files 2014-11-04 22:36:13 +10:30
spu_ovl.S Copyright update for binutils 2016-01-01 23:00:01 +10:30
spu_ovl.o_c Regenerate spu_ovl.o_c 2016-10-15 12:53:57 +10:30
spuelf.em Fix spelling in comments in .em files (ld) 2016-11-27 15:09:50 +10:30
sunos.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
tic6xdsbt.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
ticoff.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
v850elf.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
vanilla.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
vms.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
vxworks.em Copyright update for binutils 2016-01-01 23:00:01 +10:30
xtensaelf.em Don't include libbfd.h outside of bfd, part 1 2016-07-16 13:25:11 +09:30
z80.em Copyright update for binutils 2016-01-01 23:00:01 +10:30

README

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

The files in this directory are sourced by genscripts.sh, after
setting some variables to substitute in, to produce
C source files that contain jump tables for each emulation.

Copyright (C) 2012-2016 Free Software Foundation, Inc.

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.