aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-mips-elf/compressed-plt-1.s
blob: 7e7bdaa26028a3a3f41228a9ff3f56645c4f9b82 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
	.macro	call_stub, name
	.set	push
	.set	nomips16
	.section .mips16.call.\name, "ax", @progbits
	.ent	__call_stub_\name
	.type	__call_stub_\name, @function
__call_stub_\name:
	la	$25, \name
	jr	$25
	.set	pop
	.endm

	# Flags to specify how a particular function is referenced

	.equ	DC, 1		# Direct call from "compressed" code
	.equ	BC, 2		# Branch from "compressed" code
	.equ	IC, 4		# Indirect call from "compressed" code
	.equ	DU, 8		# Direct call from "uncompressed" code
	.equ	BU, 16		# Branch from "uncompressed" code
	.equ	IU, 32		# Indirect call from "uncompressed" code
	.equ	LO, 64		# Direct address reference (%lo)

	# A wrapper around a macro called test_one, which is defined by
	# the file that includes this one.  NAME is the name of a function
	# that is referenced in the way described by FLAGS, an inclusive OR
	# of the flags above.  The wrapper filters out any functions whose
	# FLAGS are not a subset of FILTER.

	.macro	test_filter, name, flags
	.if	(\flags & filter) == \flags
	test_one \name, \flags
	.endif
	.endm

	.macro	test_all_dc, name, flags
	test_filter \name, \flags
	test_filter \name\()_dc, (\flags | DC)
	.endm

	.macro	test_all_bc, name, flags
	test_all_dc \name, \flags
	test_all_dc \name\()_bc, (\flags | BC)
	.endm

	.macro	test_all_ic, name, flags
	test_all_bc \name, \flags
	test_all_bc \name\()_ic, (\flags | IC)
	.endm

	.macro	test_all_du, name, flags
	test_all_ic \name, \flags
	test_all_ic \name\()_du, (\flags | DU)
	.endm

	.macro	test_all_bu, name, flags
	test_all_du \name, \flags
	test_all_du \name\()_bu, (\flags | BU)
	.endm

	.macro	test_all_iu, name, flags
	test_all_bu \name, \flags
	test_all_bu \name\()_iu, (\flags | IU)
	.endm

	.macro	test_all_lo, name, flags
	test_all_iu \name, \flags
	test_all_iu \name\()_lo, (\flags | LO)
	.endm

	# Test all the combinations of interest.

	.macro	test_all
	test_all_lo f, 0
	.endm