binutils-gdb/ld/testsuite/ld-powerpc/notoc2.d
Alan Modra 04bdff6a76 PowerPC notoc linkage stubs
Use pcrel addressing instructions in linkage stubs.

bfd/
	* elf64-ppc.c: Comment on powerxx _notoc stub variants.
	(LI_R11_0, LIS_R11, ORI_R11_R11_0, SLDI_R11_R11_34): Define.
	(PADDI_R12_PC, PLD_R12_PC, D34, HA34): Define.
	(struct ppc_link_hash_table): Add powerxx_stubs.
	(ppc64_elf_check_relocs): Set powerxx_stubs.
	(build_powerxx_offset, size_powerxx_offset),
	(num_relocs_for_powerxx_offset),
	(emit_relocs_for_powerxx_offset): New functions.
	(plt_stub_size): Size powerxx stubs.
	(ppc_build_one_stub): Emit powerxx stubs.
	(ppc_size_one_stub): Size powerxx stubs.  Omit .eh_frame for
	powerxx stubs.
ld/
	* testsuite/ld-powerpc/notoc2.d,
	* testsuite/ld-powerpc/notoc2.s: New test.
	* testsuite/ld-powerpc/powerpc.exp: Run it.
2019-05-24 10:28:07 +09:30

29 lines
819 B
Makefile

#source: notoc2.s
#as: -a64 -mfuture
#ld: -shared -z norelro
#objdump: -d -Mfuture
#target: powerpc64*-*-*
.*
Disassembly of section \.text:
.* <.*\.plt_call\.puts>:
.*: (04 10 00 01|01 00 10 04) pld r12,66200
.*: (e5 80 02 98|98 02 80 e5)
.*: (7d 89 03 a6|a6 03 89 7d) mtctr r12
.*: (4e 80 04 20|20 04 80 4e) bctr
#...
.*: (04 13 ff ff|ff ff 13 04) pld r12,-1
.*: (e5 80 ff ff|ff ff 80 e5)
.*: (04 10 00 00|00 00 10 04) pld r12,0
.*: (e5 80 00 00|00 00 80 e5)
.*: (06 13 ff ff|ff ff 13 06) pla r12,-1
.*: (39 80 ff ff|ff ff 80 39)
.*: (06 10 00 00|00 00 10 06) pla r12,0
.*: (39 80 00 00|00 00 80 39)
.*: (06 10 00 00|00 00 10 06) pla r3,92
.*: (38 60 00 5c|5c 00 60 38)
.*: (4b ff ff 99|99 ff ff 4b) bl .* <.*\.plt_call\.puts>
.*: (60 00 00 00|00 00 00 60) nop
#pass