summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
authorwolfgang.thaller@gmx.net <unknown>2007-03-08 02:05:03 +0000
committerwolfgang.thaller@gmx.net <unknown>2007-03-08 02:05:03 +0000
commitb648333f6b4c78f7ac1528cd9f780221a058591e (patch)
tree8f3e32dba9204b81bc34ca4e7c3e5f40afd7dd3a /compiler/codeGen
parenta64842212caee26b992f32fbf451fad7edb17a18 (diff)
downloadhaskell-b648333f6b4c78f7ac1528cd9f780221a058591e.tar.gz
Make constructor names in info tables position independent
Info tables, like everything else in the text section, MUST NOT contain pointers. A pointer is, by definition, position dependent and is therefore fundamentally incompatible with generating position independent code. Therefore, we have to store an offset from the info label to the string instead of the pointer, just as we already did for other things referred to by the info table (SRTs, large bitmaps, etc.)
Diffstat (limited to 'compiler/codeGen')
-rw-r--r--compiler/codeGen/CgInfoTbls.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/codeGen/CgInfoTbls.hs b/compiler/codeGen/CgInfoTbls.hs
index fed5d804e9..da480050e0 100644
--- a/compiler/codeGen/CgInfoTbls.hs
+++ b/compiler/codeGen/CgInfoTbls.hs
@@ -89,7 +89,8 @@ emitClosureCodeAndInfoTable cl_info args body
; conName <-
if is_con
- then mkStringCLit $ fromJust conIdentity
+ then do cstr <- mkStringCLit $ fromJust conIdentity
+ return (makeRelativeRefTo info_lbl cstr)
else return (mkIntCLit 0)
; emitInfoTableAndCode info_lbl std_info (extra_bits conName) args blks }