aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-riscv-elf/ifunc-plt-02.s
blob: c3022be0e08e8238be8f3f328558cdb2b1d417df (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
	.text

	.type	foo_resolver, @function
foo_resolver:
	ret
	.size	foo_resolver, .-foo_resolver

	.globl	foo
	.type	foo, %gnu_indirect_function
	.set	foo, foo_resolver

	.globl	bar
	.type	bar, @function
bar:
.L1:
	auipc	x1, %got_pcrel_hi (foo)
.ifdef __64_bit__
	ld	x1, %pcrel_lo (.L1) (x1)
.else
	lw	x1, %pcrel_lo (.L1) (x1)
.endif

.L2:
	auipc	x2, %pcrel_hi (foo_addr)
.ifdef __64_bit__
	ld	x2, %pcrel_lo (.L2) (x2)
.else
	lw	x2, %pcrel_lo (.L2) (x2)
.endif

.L3:
	auipc	x3, %pcrel_hi (foo)
	addi	x3, x3, %pcrel_lo (.L3)

	call	foo
	call	foo@plt
	ret
	.size	bar, .-bar

	.data
foo_addr:
.ifdef __64_bit__
	.quad	foo
.else
	.long	foo
.endif