--- nasm.inc 2009/05/28 15:04:35 1.1.2.4 +++ nasm.inc 2011/02/25 12:38:37 1.9 @@ -19,7 +19,7 @@ ; * along with this program ; if not, write to the Free Software ; * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ; * -; * $Id: nasm.inc,v 1.1.2.4 2009/05/28 15:04:35 Isibaar Exp $ +; * $Id: nasm.inc,v 1.9 2011/02/25 12:38:37 Isibaar Exp $ ; * ; ***************************************************************************/ @@ -175,11 +175,15 @@ %endmacro %macro TEXT 0 -%ifidn __OUTPUT_FORMAT__,macho +%ifidn __OUTPUT_FORMAT__,macho32 + SECTION .text align=SECTION_ALIGN +%else +%ifidn __OUTPUT_FORMAT__,macho64 SECTION .text align=SECTION_ALIGN %else SECTION .rotext align=SECTION_ALIGN %endif +%endif %endmacro %macro cglobal 1 @@ -203,3 +207,15 @@ %endif %endif %endmacro + +%macro NON_EXEC_STACK 0 +%ifidn __OUTPUT_FORMAT__,elf +section .note.GNU-stack noalloc noexec nowrite progbits +%endif +%ifidn __OUTPUT_FORMAT__,elf32 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif +%ifidn __OUTPUT_FORMAT__,elf64 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif +%endmacro