summaryrefslogtreecommitdiff
path: root/compiler/GHC/CmmToLlvm/Data.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/CmmToLlvm/Data.hs
parentcf5663300c3d8b8b3c7dc2cd0dce2c923ec68987 (diff)
downloadhaskell-0004ccb885e534c386ceae21580fc59ec7ad0ede.tar.gz
llvmGen: Consider Relocatable read-only data as not constantReferences: #18137
Diffstat (limited to 'compiler/GHC/CmmToLlvm/Data.hs')
-rw-r--r--compiler/GHC/CmmToLlvm/Data.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/GHC/CmmToLlvm/Data.hs b/compiler/GHC/CmmToLlvm/Data.hs
index b8db6ba4ed..aa91621cfd 100644
--- a/compiler/GHC/CmmToLlvm/Data.hs
+++ b/compiler/GHC/CmmToLlvm/Data.hs
@@ -83,7 +83,8 @@ genLlvmData (sec, CmmStaticsRaw lbl xs) = do
Section CString _ -> if (platformArch platform == ArchS390X)
then Just 2 else Just 1
_ -> Nothing
- const = if isSecConstant sec then Constant else Global
+ const = if sectionProtection sec == ReadOnlySection
+ then Constant else Global
varDef = LMGlobalVar label tyAlias link lmsec align const
globDef = LMGlobal varDef struct