diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-07-11 15:41:55 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-07-11 16:32:43 -0400 |
commit | 9b9f978fdcd13ff7b2a9b7391e02dff06da622a0 (patch) | |
tree | 23221a07613b0866727026b201778eb5bc3d08b4 /compiler/nativeGen/AsmCodeGen.hs | |
parent | 4befb415d7ee63d2b0ecdc2384310dc4b3ccc90a (diff) | |
download | haskell-9b9f978fdcd13ff7b2a9b7391e02dff06da622a0.tar.gz |
Use correct section types syntax for architecture
Previously GHC would always assume that section types began with `@` while
producing assembly, which is not true. For instance, in ARM assembly syntax
section types begin with `%`. This abstracts out section type pretty-printing
and adjusts it to correctly account for the target architectures assembly
flavor.
Reviewers: austin, hvr, Phyx
Reviewed By: Phyx
Subscribers: Phyx, rwbarton, thomie, erikd
GHC Trac Issues: #13937
Differential Revision: https://phabricator.haskell.org/D3712
Diffstat (limited to 'compiler/nativeGen/AsmCodeGen.hs')
-rw-r--r-- | compiler/nativeGen/AsmCodeGen.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/nativeGen/AsmCodeGen.hs b/compiler/nativeGen/AsmCodeGen.hs index e7a3efdfbe..45d170e28d 100644 --- a/compiler/nativeGen/AsmCodeGen.hs +++ b/compiler/nativeGen/AsmCodeGen.hs @@ -51,6 +51,7 @@ import qualified RegAlloc.Graph.Main as Color import qualified RegAlloc.Graph.Stats as Color import qualified RegAlloc.Graph.TrivColorable as Color +import AsmUtils import TargetReg import Platform import Config @@ -770,7 +771,7 @@ makeImportsDoc dflags imports -- security. GHC generated code does not need an executable -- stack so add the note in: (if platformHasGnuNonexecStack platform - then text ".section .note.GNU-stack,\"\",@progbits" + then text ".section .note.GNU-stack,\"\"," <> sectionType "progbits" else Outputable.empty) $$ -- And just because every other compiler does, let's stick in |