diff options
Diffstat (limited to 'testing/ocaml/010_all_execstacks.patch')
-rw-r--r-- | testing/ocaml/010_all_execstacks.patch | 200 |
1 files changed, 38 insertions, 162 deletions
diff --git a/testing/ocaml/010_all_execstacks.patch b/testing/ocaml/010_all_execstacks.patch index 87e30f4028..fa47d0c309 100644 --- a/testing/ocaml/010_all_execstacks.patch +++ b/testing/ocaml/010_all_execstacks.patch @@ -1,110 +1,23 @@ Fix the EXEC_STACK in ocaml compiled binaries (#153382) -Index: ocaml-3.12.0/asmcomp/alpha/emit.mlp +Index: ocaml-4.02.2/asmrun/sparc.S =================================================================== ---- ocaml-3.12.0.orig/asmcomp/alpha/emit.mlp -+++ ocaml-3.12.0/asmcomp/alpha/emit.mlp -@@ -811,6 +811,11 @@ let data l = - ` .data\n`; - List.iter emit_item l - -+(* Mark stack as non executable *) -+let nx_stack() = -+ if Config.system = "linux" then -+ ` .section .note.GNU-stack,\"\",%progbits\n` -+ - (* Beginning / end of an assembly file *) - - let begin_assembly() = -@@ -843,6 +848,7 @@ let begin_assembly() = - `{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`; -Index: ocaml-3.12.0/asmrun/alpha.S -=================================================================== ---- ocaml-3.12.0.orig/asmrun/alpha.S -+++ ocaml-3.12.0/asmrun/alpha.S -@@ -438,3 +438,7 @@ caml_system__frametable: - .word -1 /* negative frame size => use callback link */ - .word 0 /* no roots here */ - .align 3 -+ -+#ifdef __ELF__ -+.section .note.GNU-stack,"",%progbits -+#endif -Index: ocaml-3.12.0/asmrun/arm.S -=================================================================== ---- ocaml-3.12.0.orig/asmrun/arm.S -+++ ocaml-3.12.0/asmrun/arm.S -@@ -316,3 +316,7 @@ caml_system__frametable: - .short -1 /* negative frame size => use callback link */ - .short 0 /* no roots */ - .align 2 -+ -+#ifdef __ELF__ -+.section .note.GNU-stack,"",%progbits -+#endif -Index: ocaml-3.12.0/asmrun/hppa.S -=================================================================== ---- ocaml-3.12.0.orig/asmrun/hppa.S -+++ ocaml-3.12.0/asmrun/hppa.S -@@ -532,3 +532,8 @@ G(caml_system__frametable): - .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 -+ -Index: ocaml-3.12.0/asmrun/ia64.S -=================================================================== ---- ocaml-3.12.0.orig/asmrun/ia64.S -+++ ocaml-3.12.0/asmrun/ia64.S -@@ -521,3 +521,8 @@ caml_system__frametable: - - .common caml_saved_bsp#, 8, 8 - .common caml_saved_rnat#, 8, 8 -+ -+#ifdef __ELF__ -+.section .note.GNU-stack,"",%progbits -+#endif -+ -Index: ocaml-3.12.0/asmrun/m68k.S -=================================================================== ---- ocaml-3.12.0.orig/asmrun/m68k.S -+++ ocaml-3.12.0/asmrun/m68k.S -@@ -242,3 +242,8 @@ _caml_system__frametable: - .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 -+ -Index: ocaml-3.12.0/asmrun/sparc.S -=================================================================== ---- ocaml-3.12.0.orig/asmrun/sparc.S -+++ ocaml-3.12.0/asmrun/sparc.S -@@ -405,3 +405,8 @@ Caml_system__frametable: - .type Caml_raise_exception, #function - .type Caml_system__frametable, #object +--- ocaml-4.02.2.orig/asmrun/sparc.S ++++ ocaml-4.02.2/asmrun/sparc.S +@@ -356,3 +356,8 @@ caml_system__frametable: + .type caml_raise_exception, #function + .type caml_system__frametable, #object #endif + +#ifdef __ELF__ +.section .note.GNU-stack,"",%progbits +#endif + -Index: ocaml-3.12.0/asmcomp/arm/emit.mlp +Index: ocaml-4.02.2/asmcomp/arm/emit.mlp =================================================================== ---- ocaml-3.12.0.orig/asmcomp/arm/emit.mlp -+++ ocaml-3.12.0/asmcomp/arm/emit.mlp -@@ -601,6 +601,13 @@ let data l = +--- ocaml-4.02.2.orig/asmcomp/arm/emit.mlp ++++ ocaml-4.02.2/asmcomp/arm/emit.mlp +@@ -888,6 +888,13 @@ let data l = ` .data\n`; List.iter emit_item l @@ -118,68 +31,19 @@ Index: ocaml-3.12.0/asmcomp/arm/emit.mlp (* Beginning / end of an assembly file *) let begin_assembly() = -@@ -617,6 +624,7 @@ let begin_assembly() = +@@ -920,6 +927,7 @@ let begin_assembly() = `{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`; -Index: ocaml-3.12.0/asmcomp/hppa/emit.mlp -=================================================================== ---- ocaml-3.12.0.orig/asmcomp/hppa/emit.mlp -+++ ocaml-3.12.0/asmcomp/hppa/emit.mlp -@@ -996,6 +996,12 @@ let data l = - ` .data\n`; - List.iter emit_item l - -+(* Mark stack as non executable *) -+let nx_stack() = -+ if Config.system = "linux" then -+ ` .section .note.GNU-stack,\"\",%progbits\n` -+ -+ - (* Beginning / end of an assembly file *) - - let begin_assembly() = -@@ -1024,6 +1030,7 @@ let begin_assembly() = - - - let end_assembly() = -+ nx_stack(); - ` .code\n`; - let lbl_end = Compilenv.make_symbol (Some "code_end") in - declare_global lbl_end; -Index: ocaml-3.12.0/asmcomp/ia64/emit.mlp -=================================================================== ---- ocaml-3.12.0.orig/asmcomp/ia64/emit.mlp -+++ ocaml-3.12.0/asmcomp/ia64/emit.mlp -@@ -1306,6 +1306,11 @@ let data l = - ` .align 8\n`; - List.iter emit_item l - -+(* Mark stack as non executable *) -+let nx_stack() = -+ if Config.system = "linux" then -+ ` .section .note.GNU-stack,\"\",%progbits\n` -+ - (* Beginning / end of an assembly file *) - - let begin_assembly() = -@@ -1315,6 +1320,7 @@ let begin_assembly() = - 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`; -Index: ocaml-3.12.0/asmcomp/power/emit.mlp + ` .globl {emit_symbol lbl_end}\n`; +Index: ocaml-4.02.2/asmcomp/power/emit.mlp =================================================================== ---- ocaml-3.12.0.orig/asmcomp/power/emit.mlp -+++ ocaml-3.12.0/asmcomp/power/emit.mlp -@@ -927,6 +927,12 @@ let data l = +--- ocaml-4.02.2.orig/asmcomp/power/emit.mlp ++++ ocaml-4.02.2/asmcomp/power/emit.mlp +@@ -882,6 +882,12 @@ let data l = emit_string data_space; List.iter emit_item l @@ -192,7 +56,7 @@ Index: ocaml-3.12.0/asmcomp/power/emit.mlp (* Beginning / end of an assembly file *) let begin_assembly() = -@@ -943,6 +949,7 @@ let begin_assembly() = +@@ -898,6 +904,7 @@ let begin_assembly() = `{emit_symbol lbl_begin}:\n` let end_assembly() = @@ -200,11 +64,11 @@ Index: ocaml-3.12.0/asmcomp/power/emit.mlp if pic_externals then (* Emit the pointers to external functions *) StringSet.iter emit_external !external_functions; -Index: ocaml-3.12.0/asmcomp/sparc/emit.mlp +Index: ocaml-4.02.2/asmcomp/sparc/emit.mlp =================================================================== ---- ocaml-3.12.0.orig/asmcomp/sparc/emit.mlp -+++ ocaml-3.12.0/asmcomp/sparc/emit.mlp -@@ -742,6 +742,12 @@ let data l = +--- ocaml-4.02.2.orig/asmcomp/sparc/emit.mlp ++++ ocaml-4.02.2/asmcomp/sparc/emit.mlp +@@ -724,6 +724,12 @@ let data l = ` .data\n`; List.iter emit_item l @@ -217,7 +81,7 @@ Index: ocaml-3.12.0/asmcomp/sparc/emit.mlp (* Beginning / end of an assembly file *) let begin_assembly() = -@@ -755,6 +761,7 @@ let begin_assembly() = +@@ -737,6 +743,7 @@ let begin_assembly() = `{emit_symbol lbl_begin}:\n` let end_assembly() = @@ -225,11 +89,11 @@ Index: ocaml-3.12.0/asmcomp/sparc/emit.mlp ` .text\n`; let lbl_end = Compilenv.make_symbol (Some "code_end") in ` .global {emit_symbol lbl_end}\n`; -Index: ocaml-3.12.0/asmrun/power-elf.S +Index: ocaml-4.02.2/asmrun/power-elf.S =================================================================== ---- ocaml-3.12.0.orig/asmrun/power-elf.S -+++ ocaml-3.12.0/asmrun/power-elf.S -@@ -418,3 +418,8 @@ caml_system__frametable: +--- ocaml-4.02.2.orig/asmrun/power-elf.S ++++ ocaml-4.02.2/asmrun/power-elf.S +@@ -478,3 +478,8 @@ caml_system__frametable: .long .L105 + 4 /* return address into callback */ .short -1 /* negative size count => use callback link */ .short 0 /* no roots here */ @@ -238,3 +102,15 @@ Index: ocaml-3.12.0/asmrun/power-elf.S +.section .note.GNU-stack,"",%progbits +#endif + +Index: ocaml-4.02.2/asmrun/arm.S +=================================================================== +--- ocaml-4.02.2.orig/asmrun/arm.S ++++ ocaml-4.02.2/asmrun/arm.S +@@ -498,3 +498,7 @@ caml_system__frametable: + .align 2 + .type caml_system__frametable, %object + .size caml_system__frametable, .-caml_system__frametable ++ ++#ifdef __ELF__ ++.section .note.GNU-stack,"",%progbits ++#endif |