#define JOIN(a, b) GLUE(a, b)
#define X(s) JOIN(EXTERN_ASM, s)
+#if __APPLE__
+#define R(n) r ## n
+#else
+#define R(n) n
+#endif
+
#if ARCH_PPC64
#define PTR .quad
.endm
.macro movrel rd, sym, gp
- ld \rd, \sym@got(2)
+ ld \rd, \sym@got(R(2))
.endm
.macro get_got rd