From c09e5b4b9346a5b52acbabb0b8870343cc79e366 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Thu, 18 Feb 2016 10:56:03 +0100 Subject: [PATCH 1/2] Mark stack as not executable in assembler sources --- src/asm_ia32/a.asm | 10 ++++++++++ src/asm_ia32/misc.asm | 10 ++++++++++ src/asm_ia32/tmap.asm | 10 ++++++++++ src/asm_ia32/tmap2.asm | 10 ++++++++++ src/asm_ia32/tmap3.asm | 10 ++++++++++ src/asm_x86_64/tmap3.s | 1 + 6 files changed, 51 insertions(+) diff --git a/src/asm_ia32/a.asm b/src/asm_ia32/a.asm index 786396d..9530e4c 100644 --- a/src/asm_ia32/a.asm +++ b/src/asm_ia32/a.asm @@ -810,3 +810,13 @@ align 16 GLOBAL _rtext_a_end _rtext_a_end: %endif + +%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 +%ifidn __OUTPUT_FORMAT__,elf64 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif diff --git a/src/asm_ia32/misc.asm b/src/asm_ia32/misc.asm index b825a4d..c694124 100644 --- a/src/asm_ia32/misc.asm +++ b/src/asm_ia32/misc.asm @@ -198,3 +198,13 @@ BestColor_MMX: pop ebx emms ret + +%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 +%ifidn __OUTPUT_FORMAT__,elf64 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif diff --git a/src/asm_ia32/tmap.asm b/src/asm_ia32/tmap.asm index fb372d4..05c90fd 100644 --- a/src/asm_ia32/tmap.asm +++ b/src/asm_ia32/tmap.asm @@ -1891,3 +1891,13 @@ _ASM_PatchPitch: selfmod rtext_start, rtext_end call setpitch3 jmp setvlinebpl_ + +%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 +%ifidn __OUTPUT_FORMAT__,elf64 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif diff --git a/src/asm_ia32/tmap2.asm b/src/asm_ia32/tmap2.asm index 8fa141e..81d92be 100644 --- a/src/asm_ia32/tmap2.asm +++ b/src/asm_ia32/tmap2.asm @@ -638,3 +638,13 @@ rtext_end: GLOBAL _rtext_tmap2_end _rtext_tmap2_end: %endif + +%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 +%ifidn __OUTPUT_FORMAT__,elf64 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif diff --git a/src/asm_ia32/tmap3.asm b/src/asm_ia32/tmap3.asm index bafc336..7379cb7 100644 --- a/src/asm_ia32/tmap3.asm +++ b/src/asm_ia32/tmap3.asm @@ -342,3 +342,13 @@ shift12: shr ecx,16 GLOBAL _rtext_tmap3_end _rtext_tmap3_end: %endif + +%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 +%ifidn __OUTPUT_FORMAT__,elf64 +section .note.GNU-stack noalloc noexec nowrite progbits +%endif diff --git a/src/asm_x86_64/tmap3.s b/src/asm_x86_64/tmap3.s index 867d11c..e27f05f 100644 --- a/src/asm_x86_64/tmap3.s +++ b/src/asm_x86_64/tmap3.s @@ -139,3 +139,4 @@ vltepilog: .align 16 + .section .note.GNU-stack,"",@progbits -- 2.7.2