[project @ 2005-01-28 12:55:17 by simonmar]
[ghc-hetmet.git] / ghc / compiler / codeGen / CgUtils.hs
index 414e90a..9a99bfd 100644 (file)
@@ -60,9 +60,6 @@ import Char           ( ord )
 import DATA_BITS
 import Maybe           ( isNothing )
 
-#include "../includes/ghcconfig.h"
-       -- For WORDS_BIGENDIAN
-
 -------------------------------------------------------------------------
 --
 --     Random small functions
@@ -299,7 +296,12 @@ emitDataLits lbl lits
 emitRODataLits :: CLabel -> [CmmLit] -> Code
 -- Emit a read-only data block
 emitRODataLits lbl lits
-  = emitData ReadOnlyData (CmmDataLabel lbl : map CmmStaticLit lits)
+  = emitData section (CmmDataLabel lbl : map CmmStaticLit lits)
+  where section | any needsRelocation lits = RelocatableReadOnlyData
+                | otherwise                = ReadOnlyData
+        needsRelocation (CmmLabel _)      = True
+        needsRelocation (CmmLabelOff _ _) = True
+        needsRelocation _                 = False
 
 mkStringCLit :: String -> FCode CmmLit
 -- Make a global definition for the string,