From 3eb9d5d4fe233d08f09198744e6e7328605c8275 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Tue, 31 Jan 2017 18:42:14 +0100 Subject: Hide string literals in object file --- codegen.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codegen.hs b/codegen.hs index b8d8c54..b9f822a 100644 --- a/codegen.hs +++ b/codegen.hs @@ -15,6 +15,8 @@ import qualified LLVM.General.AST.Float as A.F -- import qualified LLVM.General.AST.Name as A -- import qualified LLVM.General.AST.Instruction as A import qualified LLVM.General.AST.IntegerPredicate as A +import qualified LLVM.General.AST.Linkage as A.L +-- import qualified LLVM.General.AST.Visibility as A.V import qualified LLVM.General.AST as A import Debug.Trace @@ -236,6 +238,7 @@ genStringLiterals = liftM stringLiterals get >>= return . map gen gen :: (LLName, String) -> A.Definition gen (name, str) = A.GlobalDefinition $ A.globalVariableDefaults { A.G.name = A.Name name, + A.G.linkage = A.L.Private, A.G.isConstant = True, A.G.type' = A.ptr (A.i8), A.G.initializer = Just $ A.C.Array A.i8 $ [A.C.Int 8 (fromIntegral (ord c)) | c <- str] ++ [A.C.Int 8 0] -- cgit v1.2.3-70-g09d2