From 2fce717e25fbc288982c50c2079993706f7743bc Mon Sep 17 00:00:00 2001 From: magnum Date: Thu, 28 Nov 2024 10:08:28 +0100 Subject: [PATCH] yasm: No executable stack Closes #5588 --- src/aes/aesni/asm/x64/do_rdtsc.s | 7 +++++++ src/aes/aesni/asm/x64/iaesx64.s | 7 +++++++ src/aes/aesni/asm/x86/do_rdtsc.s | 7 +++++++ src/aes/aesni/asm/x86/iaesx86.s | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/src/aes/aesni/asm/x64/do_rdtsc.s b/src/aes/aesni/asm/x64/do_rdtsc.s index e1e8f518c72..0a84ccf2469 100644 --- a/src/aes/aesni/asm/x64/do_rdtsc.s +++ b/src/aes/aesni/asm/x64/do_rdtsc.s @@ -1,6 +1,13 @@ [bits 64] [CPU intelnop] +%ifidn __OUTPUT_FORMAT__,elf +section .note.GNU-stack noalloc noexec nowrite progbits +%endif +%ifidn __OUTPUT_FORMAT__,elf64 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif + ; Copyright (c) 2010, Intel Corporation ; All rights reserved. ; diff --git a/src/aes/aesni/asm/x64/iaesx64.s b/src/aes/aesni/asm/x64/iaesx64.s index 0c4c30e85ce..83df57f54ff 100644 --- a/src/aes/aesni/asm/x64/iaesx64.s +++ b/src/aes/aesni/asm/x64/iaesx64.s @@ -1,6 +1,13 @@ [bits 64] [CPU intelnop] +%ifidn __OUTPUT_FORMAT__,elf +section .note.GNU-stack noalloc noexec nowrite progbits +%endif +%ifidn __OUTPUT_FORMAT__,elf64 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif + ; Copyright (c) 2010, Intel Corporation ; All rights reserved. ; diff --git a/src/aes/aesni/asm/x86/do_rdtsc.s b/src/aes/aesni/asm/x86/do_rdtsc.s index 9e12aa216f1..9d6652f7af5 100644 --- a/src/aes/aesni/asm/x86/do_rdtsc.s +++ b/src/aes/aesni/asm/x86/do_rdtsc.s @@ -1,6 +1,13 @@ [bits 32] [CPU intelnop] +%ifidn __OUTPUT_FORMAT__,elf +section .note.GNU-stack noalloc noexec nowrite progbits +%endif +%ifidn __OUTPUT_FORMAT__,elf32 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif + ; Copyright (c) 2010, Intel Corporation ; All rights reserved. ; diff --git a/src/aes/aesni/asm/x86/iaesx86.s b/src/aes/aesni/asm/x86/iaesx86.s index c65921b23fe..2255ab56f08 100644 --- a/src/aes/aesni/asm/x86/iaesx86.s +++ b/src/aes/aesni/asm/x86/iaesx86.s @@ -1,6 +1,13 @@ [bits 32] [CPU intelnop] +%ifidn __OUTPUT_FORMAT__,elf +section .note.GNU-stack noalloc noexec nowrite progbits +%endif +%ifidn __OUTPUT_FORMAT__,elf32 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif + ; Copyright (c) 2010, Intel Corporation ; All rights reserved. ;