blob: dba46af752981b10d6680d1906d3385c80005797 (
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
|
.arch armv7-a
.global _start
.syntax unified
.text
.thumb
.macro do_calls
@ The following four instructions are accepted by gas, but generate
@ meaningless code.
@bl.w arm0
@bl.w arm4
@nop
@bl.w arm0
@bl.w arm4
@nop
blx.w arm0
blx.w arm4
nop
blx.w arm0
blx.w arm4
nop
bl.w thumb0
bl.w thumb2
bl.w thumb4
bl.w thumb6
nop
bl.w thumb0
bl.w thumb2
bl.w thumb4
bl.w thumb6
nop
@ These eight are all accepted by gas, but generate bad code.
@blx.w thumb0
@blx.w thumb2
@blx.w thumb4
@blx.w thumb6
@nop
@blx.w thumb0
@blx.w thumb2
@blx.w thumb4
@blx.w thumb6
.endm
.thumb_func
.align 3
_start:
do_calls
.arm
.align 3
arm0:
bx lr
.align 3
nop
arm4:
bx lr
.thumb
.thumb_func
.align 3
thumb0:
bx lr
.thumb_func
.align 3
nop
thumb2:
bx lr
.thumb_func
.align 3
nop
nop
thumb4:
bx lr
.thumb_func
.align 3
nop
nop
nop
thumb6:
bx lr
backwards:
do_calls
|