Mercurial > pub > dyncall > dyncall
comparison 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 |
comparison
equal
deleted
inserted
replaced
165:572aff021627 | 166:d5705f226298 |
---|---|
67 # define SET(K,V) K = V | 67 # define SET(K,V) K = V |
68 # define JE(X) je X | 68 # define JE(X) je X |
69 # define JNE(X) jne X | 69 # define JNE(X) jne X |
70 # define CMP(A,B) cmp B,A | 70 # define CMP(A,B) cmp B,A |
71 # define LOCAL(X) X | 71 # define LOCAL(X) X |
72 /* @@@ check if masm support wanted/needed */ | |
73 # define SECTION_NOTE_NXSTACK | |
72 #else | 74 #else |
73 /* GNU/SunPro Assembler AT&T Syntax */ | 75 /* GNU/SunPro Assembler AT&T Syntax */ |
74 .text | 76 .text |
75 # define BEGIN_ASM | 77 # define BEGIN_ASM |
76 # define END_ASM | 78 # define END_ASM |
150 # define JNE(X) jne X | 152 # define JNE(X) jne X |
151 # define FLDS(X) flds X | 153 # define FLDS(X) flds X |
152 # define FLDL(X) fldl X | 154 # define FLDL(X) fldl X |
153 # define SET(K,V) .set K,V | 155 # define SET(K,V) .set K,V |
154 # define LOCAL(X) .X | 156 # define LOCAL(X) .X |
157 /* @@@ extend following to probably *all* ELF targets - needs testing, though */ | |
158 # if defined(OS_Linux) | |
159 # define SECTION_NOTE_NXSTACK .section .note.GNU-stack,"",@progbits | |
160 # else | |
161 # define SECTION_NOTE_NXSTACK | |
162 # endif | |
155 #endif | 163 #endif |
156 | 164 |