From 619b42357a3743c9d3d006d7cc7b57d6a45f033c Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Mon, 31 Aug 2015 23:58:29 +0200 Subject: [PATCH] prevent having executable stack Add .note.GNU-stack sections to objects compiled from assembly. This allows libpsm2.so.2.0 to have non-executable stack. --- opa/opa_dwordcpy-i386.S | 4 ++++ opa/opa_dwordcpy-x86_64-fast.S | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/opa/opa_dwordcpy-i386.S b/opa/opa_dwordcpy-i386.S index 140c5d18bd..f3d898ded7 100644 --- a/opa/opa_dwordcpy-i386.S +++ b/opa/opa_dwordcpy-i386.S @@ -78,3 +78,7 @@ hfi_dwordcpy: mov %eax,%edi mov %edx,%esi ret + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif diff --git a/opa/opa_dwordcpy-x86_64-fast.S b/opa/opa_dwordcpy-x86_64-fast.S index 63e209f890..fe07ebfa92 100644 --- a/opa/opa_dwordcpy-x86_64-fast.S +++ b/opa/opa_dwordcpy-x86_64-fast.S @@ -71,3 +71,7 @@ hfi_dwordcpy: rep movsd ret + +#if defined(__linux__) && defined(__ELF__) +.section .note.GNU-stack,"",%progbits +#endif -- 2.4.3