[commit: ghc] master: Disable executable stack for the linker note, fixing #703 (again) (08a3862)

Edward Z. Yang ezyang at MIT.EDU
Tue Jul 9 09:55:54 CEST 2013


Repository : http://darcs.haskell.org/ghc.git/

On branch  : master

https://github.com/ghc/ghc/commit/08a38628f29df63ac842f4d083efb414f42d7bff

>---------------------------------------------------------------

commit 08a38628f29df63ac842f4d083efb414f42d7bff
Author: Edward Z. Yang <ezyang at mit.edu>
Date:   Tue Jul 9 00:01:43 2013 -0700

    Disable executable stack for the linker note, fixing #703 (again)
    
    Signed-off-by: Edward Z. Yang <ezyang at mit.edu>

>---------------------------------------------------------------

 compiler/main/DriverPipeline.hs | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index 67377e6..26425ae 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1640,7 +1640,17 @@ mkNoteObjsToLinkIntoBinary dflags dep_packages = do
                                    text elfSectionNote,
                                    text "\n",
 
-          text "\t.ascii \"", info', text "\"\n" ]
+          text "\t.ascii \"", info', text "\"\n",
+
+          -- ALL generated assembly must have this section to disable
+          -- executable stacks.  See also
+          -- compiler/nativeGen/AsmCodeGen.lhs for another instance
+          -- where we need to do this.
+          (if platformHasGnuNonexecStack (targetPlatform dflags)
+           then text ".section .note.GNU-stack,\"\", at progbits\n"
+           else empty)
+
+           ]
           where
             info' = text $ escape info
 





More information about the ghc-commits mailing list