[project @ 2002-12-02 14:33:10 by simonmar]
[ghc-hetmet.git] / ghc / rts / LinkerBasic.c
index 391fb92..2d3e603 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: LinkerBasic.c,v 1.2 2001/02/12 13:03:17 sewardj Exp $
+ * $Id: LinkerBasic.c,v 1.6 2002/11/21 10:04:21 simonmar Exp $
  *
  * (c) The GHC Team, 2000
  *
@@ -7,6 +7,7 @@
  *
  * ---------------------------------------------------------------------------*/
 
+#include "PosixSource.h"
 #include "Rts.h"
 #include "Hash.h"
 #include "StoragePriv.h"
@@ -24,14 +25,13 @@ ObjectCode *objects = NULL; /* initially empty */
 static __inline__ SectionKind
 lookupSection ( void* addr )
 {
-   int          i;
-   ObjectCode*  oc;
+   Section*    se;
+   ObjectCode* oc;
    
-   for ( oc = objects; oc; oc = oc->next ) {
-       for (i = 0; i < oc->n_sections; i++) {
-          if (oc->sections[i].start <= addr 
-              && addr <= oc->sections[i].end)
-              return oc->sections[i].kind;
+   for (oc=objects; oc; oc=oc->next) {
+       for (se=oc->sections; se; se=se->next) {
+          if (se->start <= addr && addr <= se->end)
+              return se->kind;
        }
    }
    return SECTIONKIND_OTHER;