[pypy-commit] pypy default: Write the progbits section magic marker to make the stack non-executable under (at least) Gentoo linux. Thanks Amaury.

arigo noreply at buildbot.pypy.org
Sat Jul 16 16:06:48 CEST 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r45663:eef75a4b072e
Date: 2011-07-16 16:06 +0200
http://bitbucket.org/pypy/pypy/changeset/eef75a4b072e/

Log:	Write the progbits section magic marker to make the stack
	non-executable under (at least) Gentoo linux. Thanks Amaury.

diff --git a/pypy/translator/c/gcc/trackgcroot.py b/pypy/translator/c/gcc/trackgcroot.py
--- a/pypy/translator/c/gcc/trackgcroot.py
+++ b/pypy/translator/c/gcc/trackgcroot.py
@@ -1824,6 +1824,11 @@
             __gccallshapes:
             """.replace("__gccallshapes", _globalname("__gccallshapes"))
             output.writelines(shapelines)
+            print >> output, """\
+            #if defined(__linux__) && defined(__ELF__)
+            .section .note.GNU-stack,"",%progbits
+            #endif
+            """
 
     def process(self, iterlines, newfile, filename='?'):
         parser = PARSERS[format](verbose=self.verbose, shuffle=self.shuffle)


More information about the pypy-commit mailing list