binutils-gdb/ld/emultempl
Alan Modra d349c8e245 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.

(cherry picked from commit e10a07b32dc1faed25b5bbcbbc47d68e2ff537b9)
2020-07-19 12:31:15 +09:30
..
README Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
aarch64elf.em Emit a warning when -z relro is unsupported 2020-06-19 09:50:20 +09:30
aix.em Show AIX gc'd symbol address adjustments in map file 2020-05-18 22:41:32 +09:30
alphaelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
arclinux.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
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 * emultempl/ostring.sed: Rename from stringify.sed. 1999-08-06 22:46:03 +00:00
avrelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
beos.em Use bfd_get_filename throughout ld 2020-05-19 12:57:15 +09:30
bfin.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
cr16elf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
crxelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
cskyelf.em ld --help output 2020-06-24 20:00:08 +09:30
elf-generic.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
elf-x86.em x86: Check static link of dynamic objects 2020-03-13 07:39:06 -07:00
elf.em Emit a warning when -z relro is unsupported 2020-06-19 09:50:20 +09:30
epiphanyelf_4x4.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
genelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
generic.em Show AIX gc'd symbol address adjustments in map file 2020-05-18 22:41:32 +09:30
hppaelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ia64elf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
irix.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
linux.em Emit a warning when -z relro is unsupported 2020-06-19 09:50:20 +09:30
m68hc1xelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
m68kelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
metagelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
mipself.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
mmix-elfnmmo.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
mmixelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
mmo.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
msp430.em Replace "if (x) free (x)" with "free (x)", ld 2020-05-21 10:45:33 +09:30
nds32elf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
needrelax.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
netbsd.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
nios2elf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ostring.sed * emultempl/ostring.sed: Rename from stringify.sed. 1999-08-06 22:46:03 +00:00
pdp11.em Fixes for the magic number used in PDP11 AOUT binaries. 2020-04-14 14:41:27 +01:00
pe.em Replace "if (x) free (x)" with "free (x)", ld 2020-05-21 10:45:33 +09:30
pep.em Replace "if (x) free (x)" with "free (x)", ld 2020-05-21 10:45:33 +09:30
ppc32elf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ppc64elf.em Power10 stub selection 2020-07-19 12:31:15 +09:30
pruelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
riscvelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
rxelf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
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 Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
scoreelf.em Emit a warning when -z relro is unsupported 2020-06-19 09:50:20 +09:30
solaris2-x86.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
solaris2.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
spu_icache.S bfd/ 2009-03-17 12:46:19 +00:00
spu_icache.o_c Regenerate spu overlay and icache manager files 2014-11-04 22:36:13 +10:30
spu_ovl.S Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
spu_ovl.o_c Regenerate spu_ovl.o_c 2016-10-15 12:53:57 +10:30
spuelf.em Use bfd_get_filename throughout ld 2020-05-19 12:57:15 +09:30
tic6xdsbt.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
ticoff.em Show AIX gc'd symbol address adjustments in map file 2020-05-18 22:41:32 +09:30
v850elf.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
vanilla.em Show AIX gc'd symbol address adjustments in map file 2020-05-18 22:41:32 +09:30
vms.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
vxworks.em Update year range in copyright notice of binutils files 2020-01-01 18:42:54 +10:30
xtensaelf.em xtensa: allow runtime ABI selection 2020-06-15 13:01:30 -07:00
z80.em Various fixes for the Z80 support. 2020-02-19 17:46:10 +00:00

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