diff options
author | Thijs Alkemade <me@thijsalkema.de> | 2016-12-06 17:12:17 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-12-06 18:44:43 -0500 |
commit | b7e88ee0d87f41cf1d8aba62aa44d5bf0a7404ad (patch) | |
tree | a80d546ceee8179f8eca6f26840da6edb74ca51e /compiler/llvmGen/LlvmCodeGen/Data.hs | |
parent | eafa06dce4aa815159ebba5a34d5137cf401ffbc (diff) | |
download | haskell-b7e88ee0d87f41cf1d8aba62aa44d5bf0a7404ad.tar.gz |
Reduce the size of string literals in binaries.
Removed the alignment for strings and mark then as cstring sections in
the generated asm so the linker can merge duplicate sections.
Reviewers: rwbarton, trofi, austin, trommler, simonmar, hvr, bgamari
Reviewed By: hvr, bgamari
Subscribers: simonpj, hvr, thomie
Differential Revision: https://phabricator.haskell.org/D1290
GHC Trac Issues: #9577
Diffstat (limited to 'compiler/llvmGen/LlvmCodeGen/Data.hs')
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen/Data.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs index 3c1af4f587..0f0ca6eeaf 100644 --- a/compiler/llvmGen/LlvmCodeGen/Data.hs +++ b/compiler/llvmGen/LlvmCodeGen/Data.hs @@ -59,6 +59,7 @@ isSecConstant (Section t _) = case t of ReadOnlyData -> True RelocatableReadOnlyData -> True ReadOnlyData16 -> True + CString -> True Data -> False UninitialisedData -> False (OtherSection _) -> False @@ -72,6 +73,7 @@ llvmSectionType t = case t of ReadOnlyData16 -> fsLit ".rodata.cst16" Data -> fsLit ".data" UninitialisedData -> fsLit ".bss" + CString -> fsLit ".cstring" (OtherSection _) -> panic "llvmSectionType: unknown section type" -- | Format a Cmm Section into a LLVM section name |