--- ocaml-3.09.3/Makefile.old 2006-11-02 17:35:02.000000000 +0100 +++ ocaml-3.09.3/Makefile 2006-11-02 17:33:08.000000000 +0100 @@ -334,7 +334,7 @@ -e 's|%%MODEL%%|$(MODEL)|' \ -e 's|%%SYSTEM%%|$(SYSTEM)|' \ -e 's|%%EXT_OBJ%%|.o|' \ - -e 's|%%EXT_ASM%%|.s|' \ + -e 's|%%EXT_ASM%%|.S|' \ -e 's|%%EXT_LIB%%|.a|' \ -e 's|%%EXT_DLL%%|.so|' \ -e 's|%%SYSTHREAD_SUPPORT%%|$(SYSTHREAD_SUPPORT)|' \ --- ocaml-3.09.3/asmcomp/i386/emit.mlp.old 2006-11-02 17:38:08.000000000 +0100 +++ ocaml-3.09.3/asmcomp/i386/emit.mlp 2006-11-02 18:15:15.000000000 +0100 @@ -914,6 +914,12 @@ ` .data\n`; List.iter emit_item l +(* Set the stack as non-executable *) +let nx_stack() = + `#ifdef __ELF__\n`; + `.section .note.GNU-stack,\"\",%progbits\n`; + `#endif\n` + (* Beginning / end of an assembly file *) let begin_assembly() = @@ -942,4 +948,5 @@ ` .long {emit_int (List.length !frame_descriptors)}\n`; List.iter emit_frame !frame_descriptors; frame_descriptors := []; + nx_stack(); if macosx then emit_external_symbols () --- ocaml-3.09.3/asmrun/i386.S.old 2006-11-02 18:05:48.000000000 +0100 +++ ocaml-3.09.3/asmrun/i386.S 2006-11-02 18:05:35.000000000 +0100 @@ -368,3 +368,6 @@ #else .zero 64 #endif +#ifdef __ELF__ + .section .note.GNU-stack,"",%progbits +#endif