From 91d2dae62cc0249671f00db03e9be330a0a586a0 Mon Sep 17 00:00:00 2001 From: "wolfgang.thaller@gmx.net" Date: Sun, 22 Oct 2006 16:06:50 +0000 Subject: [PATCH] Support RelocatableReadOnlyData section type in CmmParse, and use it where needed in AutoApply This is needed for position-independent code on Mac OS X (both i386 and powerpc), when compiling the RTS with -fasm. --- compiler/cmm/CmmParse.y | 1 + utils/genapply/GenApply.hs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/compiler/cmm/CmmParse.y b/compiler/cmm/CmmParse.y index 05ec274..20edd51 100644 --- a/compiler/cmm/CmmParse.y +++ b/compiler/cmm/CmmParse.y @@ -424,6 +424,7 @@ section :: String -> Section section "text" = Text section "data" = Data section "rodata" = ReadOnlyData +section "relrodata" = RelocatableReadOnlyData section "bss" = UninitialisedData section s = OtherSection s diff --git a/utils/genapply/GenApply.hs b/utils/genapply/GenApply.hs index 6827703..39d8506 100644 --- a/utils/genapply/GenApply.hs +++ b/utils/genapply/GenApply.hs @@ -732,7 +732,7 @@ genStackFns regstatus args genStackApplyArray types = vcat [ - text "section \"rodata\" {", + text "section \"relrodata\" {", text "stg_ap_stack_entries:", text "W_ 0; W_ 0; W_ 0;", -- ARG_GEN, ARG_GEN_BIG, ARG_BCO vcat (map arr_ent types), @@ -743,7 +743,7 @@ genStackApplyArray types = genStackSaveArray types = vcat [ - text "section \"rodata\" {", + text "section \"relrodata\" {", text "stg_stack_save_entries:", text "W_ 0; W_ 0; W_ 0;", -- ARG_GEN, ARG_GEN_BIG, ARG_BCO vcat (map arr_ent types), -- 1.7.10.4