glibc/sysdeps/s390
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
..
bits Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fpu S390: Regenerate ULPs 2017-05-09 09:18:09 +02:00
multiarch S390: Move utf8-utf32-z9.c to multiarch folder and use s390_libc_ifunc_expr macro. 2017-04-21 15:30:00 +02:00
nptl S390: Use generic spinlock code. 2017-06-06 09:41:56 +02:00
s390-32 PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
s390-64 PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
abort-instr.h S390: Use __asm__ instead of asm. 2015-11-20 08:56:40 +01:00
asm-syntax.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
atomic-machine.h Optimize generic spinlock code and use C11 like atomic macros. 2017-06-06 09:41:56 +02:00
configure S390: Do not set FE_INEXACT with feraiseexcept (FE_OWERFLOW|FE_UNDERFLOW). 2016-08-31 14:54:55 +02:00
configure.ac S390: Do not set FE_INEXACT with feraiseexcept (FE_OWERFLOW|FE_UNDERFLOW). 2016-08-31 14:54:55 +02:00
dl-irel.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-procinfo.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-procinfo.h Remove _dl_platform_string 2017-03-14 17:18:52 +01:00
dl-tls.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ffs.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
fix-fp-int-convert-overflow.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gccframe.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gconv-modules Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gmp-mparam.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Implies * math/divtc3.c: New file. 2006-02-01 03:02:06 +00:00
iso-8859-1_cp037_z900.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
jmpbuf-offsets.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
jmpbuf-unwind.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ldsodefs.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
libc-tls.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
linkmap.h S390: Use DT_JUMPREL in prelink undo code. 2016-07-06 15:22:35 +02:00
longjmp.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
machine-gmon.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Makefile Rename cppflags-iterator.mk to libof-iterator.mk, remove extra-modules.mk. 2017-05-09 07:06:29 -04:00
mempcpy.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memusage.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
preconfigure Move base_machine and machine settings from configure.ac to sysdeps preconfigure fragments. 2014-06-25 17:52:56 +00:00
sotruss-lib.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
stackinfo.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
string_private.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
utf8-utf16-z9.c S390: Move utf8-utf16-z9.c to multiarch folder and use s390_libc_ifunc_expr macro. 2017-04-21 15:30:00 +02:00
utf8-utf32-z9.c S390: Move utf8-utf32-z9.c to multiarch folder and use s390_libc_ifunc_expr macro. 2017-04-21 15:30:00 +02:00
utf16-utf32-z9.c S390: Move utf16-utf32-z9.c to multiarch folder and use s390_libc_ifunc_expr macro. 2017-04-21 15:30:00 +02:00
Versions S/390: Revert the jmp_buf/ucontext_t ABI change. 2014-07-31 20:04:54 +02:00