19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
-
-
-
+
+
+
-
-
+
-
-
+
|
.text
.align 0
.global _tramp
_tramp:
@ Immediate constants are a problem. I take the indirect load approach
@ because I don't want 4 instructions for each constant.
stmfd sp!,{r0}
ldr r0,[pc,#_data-.-8]
ldr ip,[r0,#0]
ldr r0,[pc,#_variable-.-8]
ldr r0,[pc,#12]
ldr ip,[pc,#12]
str r0,[ip]
str ip,[r0,#0]
ldmfd sp!,{r0}^
ldmfd sp!,{r0}
ldr ip,[pc,#_function-.-8]
ldr pc,[ip,#0]
ldr pc,[pc,#4]
.global _data
.align 0
_data:
.word 0x73554711
.global _variable
|