From 93b891112a9f2fc48c6e26cbd59c7b3aa04174d7 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sat, 23 Sep 2017 10:41:08 +0200 Subject: [PATCH] Non-executable stack continued The ".note.GNU-stack" section makes sense only in Linux and BSD, and is rejected by the MacOS assembler. MacOS has nonexecutable stacks by default since version 10.5 and need no special declarations. --- Changes | 2 ++ caml_z_i686.S | 3 ++- caml_z_x86_64.S | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index 2ddfaa2..318146e 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ +- On Linux and BSD, keep the stack non-executable. + Release 1.5 (2017-05-26): - Install all .cmx files, improving performance of clients and avoiding a warning from OCaml 4.03 and up. diff --git a/caml_z_i686.S b/caml_z_i686.S index bfbe559..0388eb1 100644 --- a/caml_z_i686.S +++ b/caml_z_i686.S @@ -21,8 +21,9 @@ /* makes the stack non-executable. */ +#ifdef Z_ELF .section .note.GNU-stack,"",@progbits - +#endif /* helper functions */ /* **************** */ diff --git a/caml_z_x86_64.S b/caml_z_x86_64.S index bce6b78..fe73edb 100644 --- a/caml_z_x86_64.S +++ b/caml_z_x86_64.S @@ -21,8 +21,9 @@ /* makes the stack non-executable. */ +#ifdef Z_ELF .section .note.GNU-stack,"",@progbits - +#endif /* helper functions */ /* **************** */