summaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-riscv-elf/ifunc-seperate-caller-plt.s
blob: cc1608a9803ce5d492e0b8ea25c290a6e3301eb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
	.text

	# Call the IFUNC `foo` which is defined in the other modules.
	.globl	foo
	.type	foo, %function

	.globl	main
	.type	main, @function
main:
.L1:
	auipc	x1, %got_pcrel_hi (foo)
	addi	x1, x1, %pcrel_lo (.L1)

.L2:
	auipc	x2, %pcrel_hi (foo_addr)
	addi	x2, x2, %pcrel_lo (.L2)

	call	foo
	call	foo@plt

	ret
	.size	main, .-main

	.data
foo_addr:
	.quad	foo