summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClemens Fruhwirth <clemens@endorphin.org>2007-08-06 08:44:49 +0000
committerClemens Fruhwirth <clemens@endorphin.org>2007-08-06 08:44:49 +0000
commit90ef8ab26efb2fc4172944f1066f122d3a6e7c7d (patch)
treea174022d74b5c587a810ae6d085a55966e80ad47
parentf2704299116dba4fa25c9c920c4a5150d6a4da34 (diff)
downloadhaskell-90ef8ab26efb2fc4172944f1066f122d3a6e7c7d.tar.gz
Introduce new class for external symbols in Linker.c that use __imp__<sym> instead of &<sym>
-rw-r--r--rts/Linker.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/rts/Linker.c b/rts/Linker.c
index 243eae1b76..672828c424 100644
--- a/rts/Linker.c
+++ b/rts/Linker.c
@@ -477,12 +477,12 @@ typedef struct _RtsSymbolVal {
SymX(__encodeDouble) \
SymX(__encodeFloat) \
SymX(addDLL) \
- SymX(__gmpn_gcd_1) \
- SymX(__gmpz_cmp) \
- SymX(__gmpz_cmp_si) \
- SymX(__gmpz_cmp_ui) \
- SymX(__gmpz_get_si) \
- SymX(__gmpz_get_ui) \
+ SymExtern(__gmpn_gcd_1) \
+ SymExtern(__gmpz_cmp) \
+ SymExtern(__gmpz_cmp_si) \
+ SymExtern(__gmpz_cmp_ui) \
+ SymExtern(__gmpz_get_si) \
+ SymExtern(__gmpz_get_ui) \
SymX(__int_encodeDouble) \
SymX(__int_encodeFloat) \
SymX(andIntegerzh_fast) \
@@ -766,6 +766,11 @@ typedef struct _RtsSymbolVal {
/* entirely bogus claims about types of these symbols */
#define Sym(vvv) extern void vvv(void);
+#ifdef ENABLE_WIN32_DLL_SUPPORT
+#define SymExtern(vvv) extern void _imp__ ## vvv (void);
+#else
+#define SymExtern(vvv) SymX(vvv)
+#endif
#define SymX(vvv) /**/
#define SymX_redirect(vvv,xxx) /**/
RTS_SYMBOLS
@@ -779,6 +784,7 @@ RTS_LIBGCC_SYMBOLS
#undef Sym
#undef SymX
#undef SymX_redirect
+#undef SymExtern
#ifdef LEADING_UNDERSCORE
#define MAYBE_LEADING_UNDERSCORE_STR(s) ("_" s)
@@ -789,6 +795,12 @@ RTS_LIBGCC_SYMBOLS
#define Sym(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
(void*)(&(vvv)) },
#define SymX(vvv) Sym(vvv)
+#ifdef ENABLE_WIN32_DLL_SUPPORT
+#define SymExtern(vvv) { MAYBE_LEADING_UNDERSCORE_STR(#vvv), \
+ (void*)(_imp__ ## vvv) },
+#else
+#define SymExtern(vvv) Sym(vvv)
+#endif
// SymX_redirect allows us to redirect references to one symbol to
// another symbol. See newCAF/newDynCAF for an example.