summaryrefslogtreecommitdiff
path: root/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S
diff options
context:
space:
mode:
Diffstat (limited to 'xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S')
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S15
1 files changed, 15 insertions, 0 deletions
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S
index 92788667cd..131cfc3343 100644
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_x86_64_unix.S
@@ -2,6 +2,16 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+# Darwin gives a leading '_' to symbols defined in C code.
+#ifdef XP_DARWIN
+#define SYM(x) _ ## x
+#define CFI_STARTPROC
+#define CFI_ENDPROC
+#define CFI_DEF_CFA_OFFSET(offset)
+#define CFI_OFFSET(reg, offset)
+#define CFI_DEF_CFA_REGISTER(reg)
+#define CFI_DEF_CFA(reg, offset)
+#else
#define SYM(x) x
#define CFI_STARTPROC .cfi_startproc
#define CFI_ENDPROC .cfi_endproc
@@ -9,6 +19,7 @@
#define CFI_OFFSET(reg, offset) .cfi_offset reg, offset
#define CFI_DEF_CFA_REGISTER(reg) .cfi_def_cfa_register reg
#define CFI_DEF_CFA(reg, offset) .cfi_def_cfa reg, offset
+#endif
.intel_syntax noprefix
@@ -16,7 +27,9 @@
# uint32_t argc, nsXPTCVariant* argv);
.text
.global SYM(NS_InvokeByIndex)
+#ifndef XP_DARWIN
.type NS_InvokeByIndex, @function
+#endif
.align 4
SYM(NS_InvokeByIndex):
CFI_STARTPROC
@@ -103,5 +116,7 @@ SYM(NS_InvokeByIndex):
ret
CFI_ENDPROC
+#ifndef XP_DARWIN
// Magic indicating no need for an executable stack
.section .note.GNU-stack, "", @progbits ; .previous
+#endif