summaryrefslogtreecommitdiffstats
path: root/binutils-2.24/gas/testsuite/gas/arm/branch-reloc.s
blob: b01146e20d0bad34b6b74f71bd1c64fa28901e22 (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
75
76
77
78
79
80
81
82
83
84
85
86
87
@ Check that non-local branches with and without mode switching
@ produce the right relocations with appropriate in-place addends.

	.syntax unified

	.text
	.arm
	.global arm_glob_sym1
	.global arm_glob_sym2
	.global thumb_glob_sym1
	.global thumb_glob_sym2
	nop
	.type arm_glob_sym1, %function
arm_glob_sym1:
	bl thumb_glob_sym1
	bl thumb_glob_sym2
	bl thumb_sym1
	bl arm_glob_sym1
	bl arm_glob_sym2
	bl arm_sym1
	blx thumb_glob_sym1
	blx thumb_glob_sym2
	blx thumb_sym1
	blx arm_glob_sym1
	blx arm_glob_sym2
	blx arm_sym1
	nop
	bx lr

	.type arm_sym1, %function
arm_sym1:
	nop
	bx lr

	.thumb
	.thumb_func
	.type thumb_sym1, %function
thumb_sym1:
	bx lr

	.type thumb_glob_sym1, %function
	.thumb_func
	.thumb
thumb_glob_sym1:
	bx lr

	.section foo,"ax"

@ Add some space to avoid confusing objdump output: as we are
@ producing a relocatable file, objdump may match an address to
@ the wrong symbol (as symbols in different sections may have the same
@ address in the object file).
	.space 0x100

	.type thumb_glob_sym2, %function
	.thumb_func
	.thumb
thumb_glob_sym2:
	bl arm_glob_sym1
	bl arm_glob_sym2
	bl arm_sym2
	bl thumb_glob_sym1
	bl thumb_glob_sym2
	bl thumb_sym2
	blx arm_glob_sym1
	blx arm_glob_sym2
	blx arm_sym2
	blx thumb_glob_sym1
	blx thumb_glob_sym2
	blx thumb_sym2
	nop
	bx lr

	.type thumb_sym2, %function
thumb_sym2:
	nop
	bx lr

	.arm
	.type arm_sym2, %function
arm_sym2:
	bx lr

	.global arm_glob_sym2
	.type arm_glob_sym2, %function
arm_glob_sym2:
	bx lr