[project @ 2000-10-06 15:38:06 by simonmar]
authorsimonmar <unknown>
Fri, 6 Oct 2000 15:38:06 +0000 (15:38 +0000)
committersimonmar <unknown>
Fri, 6 Oct 2000 15:38:06 +0000 (15:38 +0000)
The GC needs to be cleverer about which address ranges are in
text/data space if we're dynamically loading modules.

(BTW, this linking stuff is mostly ported from code written by Julian
Seward for STG Hugs).

ghc/includes/ClosureMacros.h
ghc/rts/GC.c

index 2e9d024..852e978 100644 (file)
@@ -1,5 +1,5 @@
 /* ----------------------------------------------------------------------------
- * $Id: ClosureMacros.h,v 1.25 2000/08/17 15:19:17 rrt Exp $
+ * $Id: ClosureMacros.h,v 1.26 2000/10/06 15:38:06 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -100,15 +100,15 @@ extern StgFun start;
 extern void* TEXT_SECTION_END_MARKER_DECL;
 extern void* DATA_SECTION_END_MARKER_DECL;
 
-#ifdef INTERPRETER
+#if defined(INTERPRETER) || defined(GHCI)
 /* Take into account code sections in dynamically loaded object files. */
 #define IS_CODE_PTR(p) (  ((P_)(p) < (P_)&TEXT_SECTION_END_MARKER) \
-                       || is_dynamically_loaded_code_or_rodata_ptr(p) )
+                       || is_dynamically_loaded_code_or_rodata_ptr((char *)p) )
 #define IS_DATA_PTR(p) ( ((P_)(p) >= (P_)&TEXT_SECTION_END_MARKER && \
                           (P_)(p) < (P_)&DATA_SECTION_END_MARKER) \
-                       || is_dynamically_loaded_rwdata_ptr(p) )
+                       || is_dynamically_loaded_rwdata_ptr((char *)p) )
 #define IS_USER_PTR(p) ( ((P_)(p) >= (P_)&DATA_SECTION_END_MARKER) \
-                       && is_not_dynamically_loaded_ptr(p) )
+                       && is_not_dynamically_loaded_ptr((char *)p) )
 #else
 #define IS_CODE_PTR(p) ((P_)(p) < (P_)&TEXT_SECTION_END_MARKER)
 #define IS_DATA_PTR(p) ((P_)(p) >= (P_)&TEXT_SECTION_END_MARKER && (P_)(p) < (P_)&DATA_SECTION_END_MARKER)
index 0600f97..ef4e7e6 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.84 2000/08/15 14:18:43 simonmar Exp $
+ * $Id: GC.c,v 1.85 2000/10/06 15:38:06 simonmar Exp $
  *
  * (c) The GHC Team 1998-1999
  *
 #  include "ParallelDebug.h"
 # endif
 #endif
+#if defined(GHCI)
+# include "HsFFI.h"
+# include "Linker.h"
+#endif
 
 //@node STATIC OBJECT LIST, Static function declarations, Includes
 //@subsection STATIC OBJECT LIST