comparison portasm/portasm-x86.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 3e629dc19168
children 2bce7629f541
comparison
equal deleted inserted replaced
165:572aff021627 166:d5705f226298
60 # define CMP(S,D) cmp D,S 60 # define CMP(S,D) cmp D,S
61 # define JE(T) je T 61 # define JE(T) je T
62 # define FLDS(OP) fld OP 62 # define FLDS(OP) fld OP
63 # define FLDL(OP) fld OP 63 # define FLDL(OP) fld OP
64 # define LOCAL(NAME) NAME 64 # define LOCAL(NAME) NAME
65 /* @@@ check if masm support wanted/needed */
66 # define SECTION_NOTE_NXSTACK
65 #else 67 #else
66 /* GNU/SunPro Assembler AT&T Syntax */ 68 /* GNU/SunPro Assembler AT&T Syntax */
67 .text 69 .text
68 # define BEGIN_ASM 70 # define BEGIN_ASM
69 # define END_ASM 71 # define END_ASM
122 # define JE(X) je X 124 # define JE(X) je X
123 # define FLDS(X) flds X 125 # define FLDS(X) flds X
124 # define FLDL(X) fldl X 126 # define FLDL(X) fldl X
125 # define ADD(A,B) add A,B 127 # define ADD(A,B) add A,B
126 # define LOCAL(X) .X 128 # define LOCAL(X) .X
129 /* @@@ extend following to probably *all* ELF targets - needs testing, though */
130 # if defined(OS_Linux)
131 # define SECTION_NOTE_NXSTACK .section .note.GNU-stack,"",@progbits
132 # else
133 # define SECTION_NOTE_NXSTACK
134 # endif
127 #endif 135 #endif
128 136