From 1b8911b4d51fbf0fb3a32dd884b57832b487e42b Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 6 Oct 2000 15:38:06 +0000 Subject: [PATCH] [project @ 2000-10-06 15:38:06 by simonmar] 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 | 10 +++++----- ghc/rts/GC.c | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ghc/includes/ClosureMacros.h b/ghc/includes/ClosureMacros.h index 2e9d024..852e978 100644 --- a/ghc/includes/ClosureMacros.h +++ b/ghc/includes/ClosureMacros.h @@ -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) diff --git a/ghc/rts/GC.c b/ghc/rts/GC.c index 0600f97..ef4e7e6 100644 --- a/ghc/rts/GC.c +++ b/ghc/rts/GC.c @@ -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 * @@ -52,6 +52,10 @@ # 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 -- 1.7.10.4