aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_ppc_asm.m4
diff options
context:
space:
mode:
authorKostis Sagonas <[email protected]>2011-02-10 02:32:27 +0200
committerNiclas Axelsson <[email protected]>2011-02-14 17:27:49 +0100
commitdbba32bf7743b2ec5952c884ab9c7007db24d760 (patch)
treee42ede6e55c309143a582b78a3675598a981a135 /erts/emulator/hipe/hipe_ppc_asm.m4
parent60826a52cbed78fa3b30bacd6d37e1c7766f5d99 (diff)
downloadotp-dbba32bf7743b2ec5952c884ab9c7007db24d760.tar.gz
otp-dbba32bf7743b2ec5952c884ab9c7007db24d760.tar.bz2
otp-dbba32bf7743b2ec5952c884ab9c7007db24d760.zip
Changes for the PPC64 backend
Diffstat (limited to 'erts/emulator/hipe/hipe_ppc_asm.m4')
-rw-r--r--erts/emulator/hipe/hipe_ppc_asm.m416
1 files changed, 16 insertions, 0 deletions
diff --git a/erts/emulator/hipe/hipe_ppc_asm.m4 b/erts/emulator/hipe/hipe_ppc_asm.m4
index 3264c78df5..0eb5c441e6 100644
--- a/erts/emulator/hipe/hipe_ppc_asm.m4
+++ b/erts/emulator/hipe/hipe_ppc_asm.m4
@@ -62,15 +62,31 @@ ifelse(OPSYS,darwin,``
#define SEMI @
#define SET_SIZE(NAME) /*empty*/
#define TYPE_FUNCTION(NAME) /*empty*/
+#define OPD(NAME) /*empty*/
'',``
/* Not Darwin */''
`ifelse(ARCH,ppc64,``
/* 64-bit */
+/*
+ * The 64-bit PowerPC ABI requires us to setup Official Procedure Descriptors
+ * for functions called from C. These are exported as "func", while the entry
+ * point should is exported as ".func". A function pointer in C points to the
+ * function descriptor in the opd rather than to the function entry point.
+ */
#define JOIN(X,Y) X##Y
#define CSYM(NAME) JOIN(.,NAME)
+#define OPD(NAME) \
+ .pushsection .opd, "aw"; \
+ .align 3; \
+ .global NAME; \
+NAME: \
+ .quad CSYM(NAME), .TOC.@tocbase, 0; \
+ .type NAME, @function; \
+ .popsection
'',``
/* 32-bit */
#define CSYM(NAME) NAME
+#define OPD(NAME) /*empty*/
'')'
``#define ASYM(NAME) NAME
#define GLOBAL(NAME) .global NAME