From 9b9f978fdcd13ff7b2a9b7391e02dff06da622a0 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 11 Jul 2017 15:41:55 -0400 Subject: 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 --- compiler/nativeGen/AsmCodeGen.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler/nativeGen/AsmCodeGen.hs') 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 -- cgit v1.2.1