--- 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 --- 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/asmrun/alpha.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/alpha.S 2006-11-02 18:53:12.000000000 +0100 @@ -438,3 +438,7 @@ .word -1 /* negative frame size => use callback link */ .word 0 /* no roots here */ .align 3 +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmrun/amd64.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/amd64.S 2006-11-02 18:53:12.000000000 +0100 @@ -334,3 +334,7 @@ .align 16 caml_absf_mask: .quad 0x7FFFFFFFFFFFFFFF, 0xFFFFFFFFFFFFFFFF +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmrun/arm.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/arm.S 2006-11-02 18:53:12.000000000 +0100 @@ -337,3 +337,7 @@ .short -1 /* negative frame size => use callback link */ .short 0 /* no roots */ .align 2 +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmrun/hppa.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/hppa.S 2006-11-02 18:53:12.000000000 +0100 @@ -532,3 +532,7 @@ .long L104 + 3 /* return address into callback */ .short -1 /* negative frame size => use callback link */ .short 0 /* no roots */ +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmrun/i386.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/i386.S 2006-11-02 18:53:12.000000000 +0100 @@ -371,3 +371,7 @@ #ifdef __ELF__ .section .note.GNU-stack,"",%progbits #endif +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmrun/ia64.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/ia64.S 2006-11-02 18:53:12.000000000 +0100 @@ -528,3 +528,7 @@ .common caml_saved_bsp#, 8, 8 .common caml_saved_rnat#, 8, 8 +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmrun/m68k.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/m68k.S 2006-11-02 18:53:12.000000000 +0100 @@ -242,3 +242,7 @@ .long L107 | return address into callback .word -1 | negative frame size => use callback link .word 0 | no roots here +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmrun/power-aix.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/power-aix.S 2006-11-02 18:53:12.000000000 +0100 @@ -511,3 +511,7 @@ .csect caml_callback3_exn[DS] caml_callback3_exn: .long .caml_callback3_exn, TOC[tc0], 0 +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmrun/power-elf.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/power-elf.S 2006-11-02 18:53:12.000000000 +0100 @@ -419,3 +419,7 @@ .short -1 /* negative size count => use callback link */ .short 0 /* no roots here */ +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmrun/power-rhapsody.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/power-rhapsody.S 2006-11-02 18:53:12.000000000 +0100 @@ -414,3 +414,7 @@ .short -1 /* negative size count => use callback link */ .short 0 /* no roots here */ +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmrun/sparc.S.old 2006-11-02 18:53:12.000000000 +0100 +++ ocaml-3.09.3/asmrun/sparc.S 2006-11-02 18:53:12.000000000 +0100 @@ -405,3 +405,7 @@ .type Caml_raise_exception, #function .type Caml_system__frametable, #object #endif +#ifdef __ELF__ +.section .note.GNU-stack,,%progbits +#endif + --- ocaml-3.09.3/asmcomp/arm/emit.mlp.old 2006-11-02 19:09:28.000000000 +0100 +++ ocaml-3.09.3/asmcomp/arm/emit.mlp 2006-11-02 19:09:41.000000000 +0100 @@ -642,6 +642,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() = @@ -661,6 +667,7 @@ `{emit_symbol lbl_begin}:\n` let end_assembly () = + nx_stack(); let lbl_end = Compilenv.make_symbol (Some "code_end") in ` .text\n`; ` .global {emit_symbol lbl_end}\n`; --- 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 19:07:22.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() = @@ -927,6 +933,7 @@ `{emit_symbol lbl_begin}:\n` let end_assembly() = + nx_stack(); let lbl_end = Compilenv.make_symbol (Some "code_end") in ` .text\n`; ` .globl {emit_symbol lbl_end}\n`; --- ocaml-3.09.3/asmcomp/ia64/emit.mlp.old 2006-11-02 19:10:14.000000000 +0100 +++ ocaml-3.09.3/asmcomp/ia64/emit.mlp 2006-11-02 19:10:25.000000000 +0100 @@ -1306,6 +1306,12 @@ ` .align 8\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() = @@ -1315,6 +1321,7 @@ emit_define_symbol (Compilenv.make_symbol (Some "code_begin")) let end_assembly () = + nx_stack(); ` .data\n`; emit_define_symbol (Compilenv.make_symbol (Some "data_end")); ` .text\n`; --- ocaml-3.09.3/asmcomp/hppa/emit.mlp.old 2006-11-02 19:09:50.000000000 +0100 +++ ocaml-3.09.3/asmcomp/hppa/emit.mlp 2006-11-02 19:10:04.000000000 +0100 @@ -994,6 +994,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() = @@ -1022,6 +1028,7 @@ let end_assembly() = + nx_stack(); ` .code\n`; let lbl_end = Compilenv.make_symbol (Some "code_end") in declare_global lbl_end; --- ocaml-3.09.3/asmcomp/mips/emit.mlp.old 2006-11-02 19:10:36.000000000 +0100 +++ ocaml-3.09.3/asmcomp/mips/emit.mlp 2006-11-02 19:10:47.000000000 +0100 @@ -546,6 +546,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() = @@ -574,6 +580,7 @@ ` .end {emit_symbol lbl_begin}\n` let end_assembly () = + nx_stack(); let lbl_end = Compilenv.make_symbol (Some "code_end") in ` .text\n`; ` .globl {emit_symbol lbl_end}\n`; --- ocaml-3.09.3/asmcomp/amd64/emit.mlp.old 2006-11-02 19:09:08.000000000 +0100 +++ ocaml-3.09.3/asmcomp/amd64/emit.mlp 2006-11-02 19:09:22.000000000 +0100 @@ -658,6 +658,13 @@ ` .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() = @@ -671,6 +678,7 @@ `{emit_symbol lbl_begin}:\n` let end_assembly() = + nx_stack(); let lbl_end = Compilenv.make_symbol (Some "code_end") in ` .text\n`; ` .globl {emit_symbol lbl_end}\n`; --- ocaml-3.09.3/asmcomp/alpha/emit.mlp.old 2006-11-02 19:08:35.000000000 +0100 +++ ocaml-3.09.3/asmcomp/alpha/emit.mlp 2006-11-02 19:09:01.000000000 +0100 @@ -811,6 +811,13 @@ ` .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() = @@ -843,6 +850,7 @@ `{emit_symbol lbl_begin}:\n` let end_assembly () = + nx_stack(); let lbl_end = Compilenv.make_symbol (Some "code_end") in ` .text\n`; ` .globl {emit_symbol lbl_end}\n`; --- ocaml-3.09.3/asmcomp/power/emit.mlp.old 2006-11-02 19:10:54.000000000 +0100 +++ ocaml-3.09.3/asmcomp/power/emit.mlp 2006-11-02 19:11:08.000000000 +0100 @@ -879,6 +879,12 @@ emit_string data_space; 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() = @@ -898,6 +904,7 @@ `{emit_symbol lbl_begin}:\n` let end_assembly() = + nx_stack(); (* Emit the jump table *) if !num_jumptbl_entries > 0 then begin emit_string code_space; --- ocaml-3.09.3/asmcomp/sparc/emit.mlp.old 2006-11-02 19:11:13.000000000 +0100 +++ ocaml-3.09.3/asmcomp/sparc/emit.mlp 2006-11-02 19:11:24.000000000 +0100 @@ -741,9 +741,16 @@ ` .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() = + nx_stack(); let lbl_begin = Compilenv.make_symbol (Some "data_begin") in ` .data\n`; ` .global {emit_symbol lbl_begin}\n`;