binutils-gdb/ld/emultempl
Alan Modra e10a07b32d Power10 stub selection
This patch better supports mixing of power10 and non-power10 code,
as might be seen in a cpu-optimized library using ifuncs to select
functions optimized for a given cpu.  Using -Wl,--no-power10-stubs
isn't that good in this situation since non-power10 notoc stubs are
slower and larger than the power10 variants, which you'd like to use
on power10 code paths.

With this change, power10 pc-relative code that makes calls marked
@notoc uses power10 stubs if stubs are necessary, and other calls use
non-power10 instructions in stubs.  This will mean that if gcc is
generating code for -mcpu=power10 but with pc-rel disabled then you'll
get the older stubs even on power10 (unless you force with
-Wl,--power10-stubs).  That shouldn't be too big a problem: stubs that
use r2 are reasonable.  It's just the ones that set up addressing
using "mflr 12; bcl 20,31,.+4; mflr 11; mtlr 12" that should be
avoided if possible.

bfd/
	* elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
	(select_alt_stub): New function.
	(ppc_get_stub_entry): Use it here.
	(ppc64_elf_check_relocs): Set had_power10_relocs rather than
	power10_stubs.
	(ppc64_elf_size_stubs): Clear power10_stubs here instead.  Don't
	merge notoc stubs with other varieties when power10_stubs is "auto".
	Instead dup the stub hash table entry.
	(plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
	tests of power10_stubs.
ld/
	* emultempl/ppc64elf.em (power10-stubs): Accept optional "auto" arg.
	* ld.texi (power10-stubs): Update.
	* testsuite/ld-powerpc/callstub-1.d: Force --power10-stubs.
	* testsuite/ld-powerpc/callstub-2.d: Relax branch offset comparison.
	* testsuite/ld-powerpc/callstub-4.d: New test.
	* testsuite/ld-powerpc/notoc.d: Force --no-power10-stubs.
	* testsuite/ld-powerpc/notoc3.d,
	* testsuite/ld-powerpc/notoc3.s,
	* testsuite/ld-powerpc/notoc3.wf: New test.
	* testsuite/ld-powerpc/powerpc.exp: Run new tests.  Pass
	--no-power10-stubs for notoc link.
2020-07-19 12:27:47 +09:30
..
aarch64elf.em Emit a warning when -z relro is unsupported 2020-06-19 09:50:20 +09:30
aix.em XCOFF linker script PROVIDE support 2020-07-07 18:26:33 +09:30
alphaelf.em
arclinux.em
armcoff.em Show AIX gc'd symbol address adjustments in map file 2020-05-18 22:41:32 +09:30
armelf.em Emit a warning when -z relro is unsupported 2020-06-19 09:50:20 +09:30
astring.sed
avrelf.em
beos.em Remove powerpc PE support 2020-07-09 22:58:16 +09:30
bfin.em
cr16elf.em
crxelf.em
cskyelf.em ld --help output 2020-06-24 20:00:08 +09:30
elf-generic.em
elf-x86.em
elf.em Emit a warning when -z relro is unsupported 2020-06-19 09:50:20 +09:30
epiphanyelf_4x4.em
genelf.em
generic.em Show AIX gc'd symbol address adjustments in map file 2020-05-18 22:41:32 +09:30
hppaelf.em
ia64elf.em
irix.em
linux.em Emit a warning when -z relro is unsupported 2020-06-19 09:50:20 +09:30
m68hc1xelf.em
m68kelf.em
metagelf.em
mipself.em
mmix-elfnmmo.em
mmixelf.em
mmo.em
msp430.em Replace "if (x) free (x)" with "free (x)", ld 2020-05-21 10:45:33 +09:30
nds32elf.em
needrelax.em
netbsd.em
nios2elf.em
ostring.sed
pdp11.em
pe.em Remove powerpc PE support 2020-07-09 22:58:16 +09:30
pep.em Replace "if (x) free (x)" with "free (x)", ld 2020-05-21 10:45:33 +09:30
ppc32elf.em
ppc64elf.em Power10 stub selection 2020-07-19 12:27:47 +09:30
pruelf.em
README
riscvelf.em
rxelf.em
rxlinux.em ld: Add rx-linux emulation. gas: Change ELF flags initial value in rx-linux 2020-04-30 13:35:37 +01:00
s390.em
scoreelf.em Emit a warning when -z relro is unsupported 2020-06-19 09:50:20 +09:30
solaris2-x86.em
solaris2.em
spu_icache.o_c
spu_icache.S
spu_ovl.o_c
spu_ovl.S
spuelf.em Use bfd_get_filename throughout ld 2020-05-19 12:57:15 +09:30
tic6xdsbt.em
ticoff.em Show AIX gc'd symbol address adjustments in map file 2020-05-18 22:41:32 +09:30
v850elf.em
vanilla.em Show AIX gc'd symbol address adjustments in map file 2020-05-18 22:41:32 +09:30
vms.em
vxworks.em
xtensaelf.em xtensa: allow runtime ABI selection 2020-06-15 13:01:30 -07:00
z80.em

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-2020 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.