summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToC.hs
diff options
context:
space:
mode:
authorTuan Le <ihnaut.if@gmail.com>2020-05-04 16:40:01 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-05-21 12:16:46 -0400
commit0004ccb885e534c386ceae21580fc59ec7ad0ede (patch)
treeeb377eaf30ed7e5e02d02005210b515b869bd88d /compiler/GHC/CmmToC.hs
parentcf5663300c3d8b8b3c7dc2cd0dce2c923ec68987 (diff)
downloadhaskell-0004ccb885e534c386ceae21580fc59ec7ad0ede.tar.gz
llvmGen: Consider Relocatable read-only data as not constantReferences: #18137
Diffstat (limited to 'compiler/GHC/CmmToC.hs')
-rw-r--r--compiler/GHC/CmmToC.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/CmmToC.hs b/compiler/GHC/CmmToC.hs
index f4b8878fe2..d7b3fb05eb 100644
--- a/compiler/GHC/CmmToC.hs
+++ b/compiler/GHC/CmmToC.hs
@@ -129,6 +129,10 @@ pprTop dflags = \case
pprDataExterns platform lits $$
pprWordArray dflags (isSecConstant section) lbl lits
where
+ isSecConstant section = case sectionProtection section of
+ ReadOnlySection -> True
+ WriteProtectedSection -> True
+ _ -> False
platform = targetPlatform dflags
-- --------------------------------------------------------------------------