summaryrefslogtreecommitdiff
path: root/compiler/llvmGen/LlvmCodeGen/Ppr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/llvmGen/LlvmCodeGen/Ppr.hs')
-rw-r--r--compiler/llvmGen/LlvmCodeGen/Ppr.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Ppr.hs b/compiler/llvmGen/LlvmCodeGen/Ppr.hs
index 9c6a719613..80e8949ac8 100644
--- a/compiler/llvmGen/LlvmCodeGen/Ppr.hs
+++ b/compiler/llvmGen/LlvmCodeGen/Ppr.hs
@@ -114,12 +114,18 @@ pprInfoTable count info_lbl stat
= do (ldata, ltypes) <- genLlvmData (Text, stat)
dflags <- getDynFlags
+ platform <- getLlvmPlatform
let setSection (LMGlobal (LMGlobalVar _ ty l _ _ c) d) = do
lbl <- strCLabel_llvm info_lbl
let sec = mkLayoutSection count
ilabel = lbl `appendFS` fsLit iTableSuf
gv = LMGlobalVar ilabel ty l sec (llvmInfAlign dflags) c
- v = if l == Internal then [gv] else []
+ -- See Note [Subsections Via Symbols]
+ v = if (platformHasSubsectionsViaSymbols platform
+ && l == ExternallyVisible)
+ || l == Internal
+ then [gv]
+ else []
funInsert ilabel ty
return (LMGlobal gv d, v)
setSection v = return (v,[])