binutils-gdb/ld/testsuite/ld-powerpc/elfv2.s
Alan Modra 33cb30a1f9 Implement PowerPC64 .localentry for value 1
This adds support for ".localentry 1", a new st_other
STO_PPC64_LOCAL_MASK encoding that signifies a function with a single
entry point like ".localentry 0", but unlike a ".localentry 0"
function does not preserve r2.

include/
	* elf/ppc64.h: Specify byte offset to local entry for values
	of two to six in STO_PPC64_LOCAL_MASK.  Clarify r2 return
	value for such functions when entering via global entry point.
	Specify meaning of a value of one in STO_PPC64_LOCAL_MASK.
bfd/
	* elf64-ppc.c (ppc64_elf_size_stubs): Use a ppc_stub_long_branch_r2off
	for calls to symbols with STO_PPC64_LOCAL_MASK bits set to 1.
gas/
	* config/tc-ppc.c (ppc_elf_localentry): Allow .localentry values
	of 1 and 7 to directly set value into STO_PPC64_LOCAL_MASK bits.
ld/testsuite/
	* ld-powerpc/elfv2.s: Add .localentry f5,1 testcase.
	* ld-powerpc/elfv2exe.d: Update.
	* ld-powerpc/elfv2so.d: Update.
2018-07-26 12:53:50 +09:30

42 lines
424 B
ArmAsm

.section .toc,"aw",@progbits
.L0:
.quad x
.data
x:
.quad f1
.globl f1
.type f1,@function
.text
f1:
addis 2,12,.TOC.-f1@ha
addi 2,2,.TOC.-f1@l
.localentry f1,.-f1
mflr 0
stdu 1,-32(1)
std 0,48(1)
bl f1
ld 3,.L0@toc(2)
bl f2
nop
ld 3,x@got(2)
bl f3
nop
bl f4
nop
bl f5
nop
ld 0,48(1)
addi 1,1,32
mtlr 0
blr
.size f1,.-f1
.globl f5
.type f5,@function
f5:
.localentry f5,1
blr
.size f5,.-f5