aboutsummaryrefslogtreecommitdiff
path: root/Debugger/debug_test.S
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2012-09-05 14:12:13 +0800
committerTat-Chee Wan (USM)2012-09-05 14:12:13 +0800
commitaa0778c0d89f9f0722428e419866ff3aedf06bf2 (patch)
tree5aa23e5535fffa4868c4566626abd03c9d23b7b1 /Debugger/debug_test.S
parentcf42b7bf19c5439adaeda8c36bab0893a9e83eed (diff)
updated arm function label declarations to use .type directive for interworking
Newer binutils (>2.21) does not handle interworking correctly if the .type directive is not used for ARM functions. The fix is to add a private copy of the arm_interwork macro to the debugger stub to avoid this issue when calling ARM routines from Thumb (used by NIF).
Diffstat (limited to 'Debugger/debug_test.S')
-rw-r--r--Debugger/debug_test.S21
1 files changed, 11 insertions, 10 deletions
diff --git a/Debugger/debug_test.S b/Debugger/debug_test.S
index 7f8c85f..2cb87a0 100644
--- a/Debugger/debug_test.S
+++ b/Debugger/debug_test.S
@@ -23,8 +23,7 @@
* dbg__test_arm_bkpt Test Routine
*
*/
- .global dbg__test_arm_bkpt
-dbg__test_arm_bkpt:
+ dbg_interwork dbg__test_arm_bkpt
stmfd sp!,{lr}
dbg__bkpt_arm /* Trigger ARM Manual Breakpoint */
ldmfd sp!,{pc}
@@ -38,8 +37,7 @@ dbg__test_arm_bkpt:
* In addition, conditional instructions are also evaluated.
*
*/
- .global dbg__test_arm_instrstep
-dbg__test_arm_instrstep:
+ dbg_interwork dbg__test_arm_instrstep
stmfd sp!, {lr}
bl dbg__test_arm_instr_sub1
ldr r1, =test_arm_3 /* R1: pointer to test_arm_3 */
@@ -85,8 +83,7 @@ dbg__test_arm_instr_sub2:
* dbg__test_thumb_bkpt Test Routine
*
*/
- .global dbg__test_thumb_bkpt
-dbg__test_thumb_bkpt:
+ dbg_interwork dbg__test_thumb_bkpt
stmfd sp!,{lr}
/* ldr r0, =_thumb_entry
orr r0, r0, #1 @ Set Thumb mode
@@ -97,7 +94,8 @@ dbg__test_thumb_bkpt:
ldmfd sp!,{pc}
.code 16
-.thumb_func
+ .thumb_func
+ .type _thumb_entry, %function
_thumb_entry:
dbg__bkpt_thumb
bx lr
@@ -109,7 +107,8 @@ _thumb_entry:
*
*/
.global dbg__test_thumb_instrstep
-.thumb_func
+ .thumb_func
+ .type dbg__test_thumb_instrstep, %function
dbg__test_thumb_instrstep:
push {lr}
bl dbg__test_thumb_instr_sub1
@@ -145,12 +144,14 @@ exit_dbg__test_thumb_instrstep:
pop {r1}
bx r1
-.thumb_func
+ .thumb_func
+ .type dbg__test_thumb_instr_sub1, %function
dbg__test_thumb_instr_sub1:
mov r0, #0x0F
bx lr
-.thumb_func
+ .thumb_func
+ .type dbg__test_thumb_instr_sub2, %function
dbg__test_thumb_instr_sub2:
push {lr}
mov r1, #FALSE