From aa0778c0d89f9f0722428e419866ff3aedf06bf2 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Wed, 5 Sep 2012 14:12:13 +0800 Subject: 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). --- Debugger/debug_stub.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Debugger/debug_stub.h') diff --git a/Debugger/debug_stub.h b/Debugger/debug_stub.h index 6807ac1..2430e77 100644 --- a/Debugger/debug_stub.h +++ b/Debugger/debug_stub.h @@ -145,6 +145,20 @@ static inline void dbg_breakpoint_thumb(void) { asm volatile (".hword 0xBE7F" /* .hword (BKPT16_INSTR | BKPT16_MANUAL_BKPT) .endm +/** Macro to declare Interworking ARM Routine + * + * dbg_interwork + * + * Note: declared as a private macro since ARMDEBUG is also used by NIF + */ + .macro dbg_interwork arm_routine + .align 4 + .arm + .type \arm_routine, %function @ Needed by new binutils (>2.21) + .global \arm_routine +\arm_routine: + .endm + #endif /*@}*/ -- cgit v1.2.3