Date: Tue, 1 Nov 2005 20:25:10 +0100
authorSam Lantinga
Tue, 01 Nov 2005 23:19:59 +0000
changeset 1166da33b7e6d181
parent 1165 4fa705cdecb9
child 1167 435c2e481299
Date: Tue, 1 Nov 2005 20:25:10 +0100
From: Dirk Mueller
Subject: [PATCH] build SDL with nonexecutable stack


libSDL is by default marked with an executable stack, which it doesn't
actually need. the reason for this is that there are assembler files in the
source tree not properly annotated with the "noexec stack" section. As such
the linker does a safe-fallback and marks the whole lib as "requires
executable stack".

the patch below removes this by adding annotations. As far as I can see it
shouldn't break anything.
src/hermes/mmx_main.asm
src/hermes/mmxp2_32.asm
src/hermes/x86_main.asm
src/hermes/x86p_16.asm
src/hermes/x86p_32.asm
     1.1 --- a/src/hermes/mmx_main.asm	Tue Nov 01 04:18:08 2005 +0000
     1.2 +++ b/src/hermes/mmx_main.asm	Tue Nov 01 23:19:59 2005 +0000
     1.3 @@ -13,6 +13,7 @@
     1.4  GLOBAL _mmxreturn
     1.5  
     1.6  
     1.7 +SECTION .note.GNU-stack noalloc progbits noexec nowrite
     1.8  SECTION .text
     1.9  		
    1.10  ;; _ConvertMMX:	 
     2.1 --- a/src/hermes/mmxp2_32.asm	Tue Nov 01 04:18:08 2005 +0000
     2.2 +++ b/src/hermes/mmxp2_32.asm	Tue Nov 01 23:19:59 2005 +0000
     2.3 @@ -29,6 +29,7 @@
     2.4  
     2.5  EXTERN _mmxreturn
     2.6   
     2.7 +SECTION .note.GNU-stack noalloc progbits noexec nowrite
     2.8  SECTION .data
     2.9  	
    2.10  ALIGN 8
     3.1 --- a/src/hermes/x86_main.asm	Tue Nov 01 04:18:08 2005 +0000
     3.2 +++ b/src/hermes/x86_main.asm	Tue Nov 01 23:19:59 2005 +0000
     3.3 @@ -16,7 +16,7 @@
     3.4  	
     3.5  GLOBAL _Hermes_X86_CPU
     3.6  
     3.7 -
     3.8 +SECTION .note.GNU-stack noalloc progbits noexec nowrite
     3.9  SECTION .data
    3.10  	
    3.11  cpu_flags dd 0
     4.1 --- a/src/hermes/x86p_16.asm	Tue Nov 01 04:18:08 2005 +0000
     4.2 +++ b/src/hermes/x86p_16.asm	Tue Nov 01 23:19:59 2005 +0000
     4.3 @@ -27,7 +27,7 @@
     4.4  EXTERN _ConvertX86
     4.5  EXTERN _x86return
     4.6  
     4.7 -
     4.8 +SECTION .note.GNU-stack noalloc progbits noexec nowrite
     4.9  SECTION .text
    4.10  
    4.11  
     5.1 --- a/src/hermes/x86p_32.asm	Tue Nov 01 04:18:08 2005 +0000
     5.2 +++ b/src/hermes/x86p_32.asm	Tue Nov 01 23:19:59 2005 +0000
     5.3 @@ -24,7 +24,8 @@
     5.4  GLOBAL _ConvertX86p32_8RGB332
     5.5  
     5.6  EXTERN _x86return
     5.7 -		
     5.8 +	
     5.9 +SECTION .note.GNU-stack noalloc progbits noexec nowrite
    5.10  SECTION .text
    5.11  
    5.12