turn off executable stack flag in executables (#973512)
- reported by Dhiru Kholia
- upstream patch by Edward Zhang:
see http://ghc.haskell.org/trac/ghc/ticket/703 and
08a38628f2
- this affects both ghc 7.4 and 7.6
epel9
parent
5a78a2efb5
commit
cbe15a3bdf
@ -0,0 +1,32 @@
|
|||||||
|
commit 08a38628f29df63ac842f4d083efb414f42d7bff
|
||||||
|
Author: Edward Z. Yang <ezyang@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@mit.edu>
|
||||||
|
|
||||||
|
Modified compiler/main/DriverPipeline.hs
|
||||||
|
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,\"\",@progbits\n"
|
||||||
|
+ else empty)
|
||||||
|
+
|
||||||
|
+ ]
|
||||||
|
where
|
||||||
|
info' = text $ escape info
|
||||||
|
|
Loading…
Reference in new issue