Darwin/aarch64: Use CNAME, restrict .size like ARM

This commit is contained in:
Zachary Waldowski
2013-12-30 16:33:47 -05:00
parent 0717578080
commit 5658b08926

View File

@@ -23,14 +23,30 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <fficonfig.h> #include <fficonfig.h>
#include <ffi.h> #include <ffi.h>
#ifdef HAVE_MACHINE_ASM_H
#include <machine/asm.h>
#else
#ifdef __USER_LABEL_PREFIX__
#define CONCAT1(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a ## b
/* Use the right prefix for global labels. */
#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x)
#else
#define CNAME(x) x
#endif
#endif
#define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off #define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
#define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off #define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
#define cfi_restore(reg) .cfi_restore reg #define cfi_restore(reg) .cfi_restore reg
#define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg #define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
.text .text
.globl ffi_call_SYSV .globl CNAME(ffi_call_SYSV)
.type ffi_call_SYSV, #function #ifdef __ELF__
.type CNAME(ffi_call_SYSV), #function
#endif
/* ffi_call_SYSV() /* ffi_call_SYSV()
@@ -82,7 +98,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#define ffi_call_SYSV_FS (8 * 4) #define ffi_call_SYSV_FS (8 * 4)
.cfi_startproc .cfi_startproc
ffi_call_SYSV: CNAME(ffi_call_SYSV):
stp x29, x30, [sp, #-16]! stp x29, x30, [sp, #-16]!
cfi_adjust_cfa_offset (16) cfi_adjust_cfa_offset (16)
cfi_rel_offset (x29, 0) cfi_rel_offset (x29, 0)
@@ -180,7 +196,9 @@ ffi_call_SYSV:
ret ret
.cfi_endproc .cfi_endproc
.size ffi_call_SYSV, .-ffi_call_SYSV #ifdef __ELF__
.size CNAME(ffi_call_SYSV), .-CNAME(ffi_call_SYSV)
#endif
#define ffi_closure_SYSV_FS (8 * 2 + AARCH64_CALL_CONTEXT_SIZE) #define ffi_closure_SYSV_FS (8 * 2 + AARCH64_CALL_CONTEXT_SIZE)
@@ -222,9 +240,9 @@ ffi_call_SYSV:
Voila! */ Voila! */
.text .text
.globl ffi_closure_SYSV .globl CNAME(ffi_closure_SYSV)
.cfi_startproc .cfi_startproc
ffi_closure_SYSV: CNAME(ffi_closure_SYSV):
stp x29, x30, [sp, #-16]! stp x29, x30, [sp, #-16]!
cfi_adjust_cfa_offset (16) cfi_adjust_cfa_offset (16)
cfi_rel_offset (x29, 0) cfi_rel_offset (x29, 0)
@@ -270,7 +288,7 @@ ffi_closure_SYSV:
trampoline was called. */ trampoline was called. */
add x2, x29, #16 add x2, x29, #16
bl ffi_closure_SYSV_inner bl CNAME(ffi_closure_SYSV_inner)
/* Figure out if we should touch the vector registers. */ /* Figure out if we should touch the vector registers. */
ldr x0, [x22, #8] ldr x0, [x22, #8]
@@ -304,4 +322,6 @@ ffi_closure_SYSV:
ret ret
.cfi_endproc .cfi_endproc
.size ffi_closure_SYSV, .-ffi_closure_SYSV #ifdef __ELF__
.size CNAME(ffi_closure_SYSV), .-CNAME(ffi_closure_SYSV)
#endif