This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libffi: conditionally compile unwinder directives.
- From: Andrew Haley <aph-gcc at littlepinkcloud dot COM>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 29 Aug 2007 17:10:53 +0100
- Subject: libffi: conditionally compile unwinder directives.
Since libffi may be used by non-ELF toolchains, we have to
conditionally compile unwinder directives.
Andrew.
2007-08-29 Andrew Haley <aph@redhat.com>
* src/arm/sysv.S (UNWIND): New.
(Whole file): Conditionally compile unwinder directives.
Index: src/arm/sysv.S
===================================================================
--- src/arm/sysv.S (revision 127695)
+++ src/arm/sysv.S (working copy)
@@ -82,6 +82,14 @@
# define call_reg(x) mov lr, pc ; mov pc, x
#endif
+/* Conditionally compile unwinder directives. */
+#ifdef __ARM_EABI__
+#define UNWIND
+#else
+#define UNWIND @
+#endif
+
+
#if defined(__thumb__) && !defined(__THUMB_INTERWORK__)
.macro ARM_FUNC_START name
.text
@@ -92,7 +100,7 @@
bx pc
nop
.arm
- .fnstart
+ UNWIND .fnstart
/* A hook to tell gdb that we've switched to ARM mode. Also used to call
directly from other local arm routines. */
_L__\name:
@@ -103,7 +111,7 @@
.align 0
.arm
ENTRY(\name)
- .fnstart
+ UNWIND .fnstart
.endm
#endif
@@ -136,10 +144,10 @@
ARM_FUNC_START ffi_call_SYSV
@ Save registers
stmfd sp!, {r0-r3, fp, lr}
- .save {r0-r3, fp, lr}
+ UNWIND .save {r0-r3, fp, lr}
mov fp, sp
- .setfp fp, sp
+ UNWIND .setfp fp, sp
@ Make room for all of the new args.
sub sp, fp, r2
@@ -210,7 +218,7 @@
RETLDM "r0-r3,fp"
.ffi_call_SYSV_end:
- .fnend
+ UNWIND .fnend
.size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV)
/*
@@ -222,10 +230,10 @@
*/
ARM_FUNC_START ffi_closure_SYSV
- .pad #16
+ UNWIND .pad #16
add ip, sp, #16
stmfd sp!, {ip, lr}
- .save {r0, lr}
+ UNWIND .save {r0, lr}
add r2, sp, #8
.pad #16
sub sp, sp, #16
@@ -282,6 +290,6 @@
#endif
.ffi_closure_SYSV_end:
- .fnend
+ UNWIND .fnend
.size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closur
e_SYSV)