diff portasm/portasm-x64.S @ 166:d5705f226298

- added portasm support for adding .section .note.GNU-stack "hints" marking generated .o files from assembly files as not needing an executable stack * needed to be done manually in assembly files, in contrast to C translation units where gcc adds such hints automatically * this is for security, and better/easier integration of dyncall into other projects and builds, as dyncall doesn't need an executable stack * thanks to Thorsten Behrens for bringing this up to our intention and providing a first analysis * currently only done on Linux, but will be added across other platforms (where applicable) after some testing
author cslag
date Thu, 05 Jan 2017 11:07:29 +0100
parents 572aff021627
children 2bce7629f541
line wrap: on
line diff
--- a/portasm/portasm-x64.S	Thu Jan 05 10:35:12 2017 +0100
+++ b/portasm/portasm-x64.S	Thu Jan 05 11:07:29 2017 +0100
@@ -69,6 +69,8 @@
 #  define JNE(X) jne X
 #  define CMP(A,B) cmp B,A
 #  define LOCAL(X) X
+/* @@@ check if masm support wanted/needed */
+#  define SECTION_NOTE_NXSTACK
 #else
 /* GNU/SunPro Assembler AT&T Syntax */
 	.text
@@ -152,5 +154,11 @@
 #  define FLDL(X)  fldl X
 #  define SET(K,V) .set K,V
 #  define LOCAL(X) .X
+/* @@@ extend following to probably *all* ELF targets - needs testing, though */
+#  if defined(OS_Linux)
+#    define SECTION_NOTE_NXSTACK .section .note.GNU-stack,"",@progbits
+#  else
+#    define SECTION_NOTE_NXSTACK
+#  endif
 #endif