glibc/sysdeps/powerpc/powerpc64
Alan Modra 0572433b5b PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY
ELFv2 functions with localentry:0 are those with a single entry point,
ie. global entry == local entry, that have no requirement on r2 or
r12 and guarantee r2 is unchanged on return.  Such an external
function can be called via the PLT without saving r2 or restoring it
on return, avoiding a common load-hit-store for small functions.

This patch implements the ld.so changes necessary for this
optimization.  ld.so needs to check that an optimized plt call
sequence is in fact calling a function implemented with localentry:0,
end emit a fatal error otherwise.

The elf/testobj6.c change is to stop "error while loading shared
libraries: expected localentry:0 `preload'" when running
elf/preloadtest, which we'd get otherwise.

	* elf/elf.h (PPC64_OPT_LOCALENTRY): Define.
	* sysdeps/alpha/dl-machine.h (elf_machine_fixup_plt): Add
	refsym and sym parameters.  Adjust callers.
	* sysdeps/aarch64/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/arm/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/generic/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/hppa/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/i386/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/ia64/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/m68k/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/microblaze/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/mips/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/nios2/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_fixup_plt):
	Likewise.
	* sysdeps/s390/s390-32/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/s390/s390-64/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/sh/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/tile/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/x86_64/dl-machine.h (elf_machine_fixup_plt): Likewise.
	* sysdeps/powerpc/powerpc64/dl-machine.c (_dl_error_localentry): New.
	(_dl_reloc_overflow): Increase buffser size.  Formatting.
	* sysdeps/powerpc/powerpc64/dl-machine.h (ppc64_local_entry_offset):
	Delete reloc param, add refsym and sym.  Check optimized plt
	call stubs for localentry:0 functions.  Adjust callers.
	(elf_machine_fixup_plt, elf_machine_plt_conflict): Add refsym
	and sym parameters.  Adjust callers.
	(_dl_reloc_overflow): Move attribute.
	(_dl_error_localentry): Declare.
	* elf/dl-runtime.c (_dl_fixup): Save original sym.  Pass
	refsym and sym to elf_machine_fixup_plt.
	* elf/testobj6.c (preload): Call printf.
2017-06-14 10:47:25 +09:30
..
970 powerpc: Re-work the Implies structure 2010-06-30 09:57:38 -07:00
a2 PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
bits Define wordsize.h macros everywhere 2016-11-04 09:37:44 -07:00
cell PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
fpu PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
multiarch PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
power4 PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
power5 PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
power5+ PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
power6 PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
power6x PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
power7 PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
power8 PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
power9 PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
__longjmp-common.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
__longjmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
addmul_1.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
atomic-machine.h Optimize generic spinlock code and use C11 like atomic macros. 2017-06-06 09:41:56 +02:00
backtrace.c powerpc: Fix signal handling in backtrace 2017-05-11 17:27:31 -03:00
bsd-_setjmp.S PowerPC64 ABI fixes 2010-08-12 09:19:19 -07:00
bsd-setjmp.S PowerPC64 ABI fixes 2010-08-12 09:19:19 -07:00
bzero.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
configure powerpc64 configure message 2015-03-25 15:45:36 +10:30
configure.ac powerpc64 configure message 2015-03-25 15:45:36 +10:30
crti.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
crtn.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-dtprocnum.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-irel.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-machine.c PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
dl-machine.h PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
dl-trampoline.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
entry.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ffsll.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
hp-timing.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Implies Revert "Use ieee754/dbl-64/wordsize-64 on powerpc64" 2013-01-10 10:44:05 +01:00
lshift.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
Makefile Remove HP_TIMING_DIFF_INIT and dl_hp_timing_overhead 2014-07-03 08:38:25 -07:00
memcpy.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
memset.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
mul_1.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
ppc-mcount.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
register-dump.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
rtld-memset.c powerpc: Use generic memset for RTLD for ppc32/64 2010-09-29 12:21:14 -04:00
setjmp-common.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
setjmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
stackguard-macros.h PowerPC: Fix POINTER_CHK_GUARD thread register for PPC64 2013-09-25 13:43:04 -05:00
start.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
strchr.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
strcmp.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
strlen.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
strncmp.S PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
submul_1.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sysdep.h PowerPC64 ENTRY_TOCLESS 2017-06-14 10:45:50 +09:30
tls-macros.h powerpc: Remove HAVE_ASM_GLOBAL_DOT_NAME define 2015-03-11 09:01:05 -04:00
tst-audit.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00