From fcdc6a7d2488defd66bc7e8398c6d8c9a6190a1a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 17 Apr 2006 18:58:24 +0000 Subject: [PATCH] Add .note.GNU-stack section to assembler files to avoid the default behavior of requesting executable stacks. --- src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S | 4 ++++ src/mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S | 4 ++++ src/mesa/glapi/gl_x86-64_asm.py | 4 ++++ src/mesa/glapi/gl_x86_asm.py | 4 ++++ src/mesa/tnl/t_vtx_x86_gcc.S | 4 ++++ src/mesa/x86-64/glapi_x86-64.S | 4 ++++ src/mesa/x86-64/xform4.S | 6 +++++- src/mesa/x86/3dnow_normal.S | 6 +++++- src/mesa/x86/3dnow_xform1.S | 6 +++++- src/mesa/x86/3dnow_xform2.S | 6 +++++- src/mesa/x86/3dnow_xform3.S | 6 +++++- src/mesa/x86/3dnow_xform4.S | 6 +++++- src/mesa/x86/common_x86_asm.S | 4 ++++ src/mesa/x86/glapi_x86.S | 4 ++++ src/mesa/x86/mmx_blend.S | 4 ++++ src/mesa/x86/read_rgba_span_x86.S | 4 ++++ src/mesa/x86/sse_normal.S | 6 +++++- src/mesa/x86/sse_xform1.S | 6 +++++- src/mesa/x86/sse_xform2.S | 6 +++++- src/mesa/x86/sse_xform3.S | 6 +++++- src/mesa/x86/sse_xform4.S | 6 +++++- src/mesa/x86/x86_cliptest.S | 6 +++++- src/mesa/x86/x86_xform2.S | 6 +++++- src/mesa/x86/x86_xform3.S | 6 +++++- src/mesa/x86/x86_xform4.S | 6 +++++- 25 files changed, 115 insertions(+), 15 deletions(-) diff --git a/src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S b/src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S index 57a35c657b8..5e33c7bdeea 100644 --- a/src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S +++ b/src/mesa/drivers/dri/r200/r200_vtxtmp_x86.S @@ -493,3 +493,7 @@ GLOBL( _sse_MultiTexCoord2f_2 ) ret GLOBL( _sse_MultiTexCoord2f_2_end ) #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S b/src/mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S index d2bb1d15192..1b433491aa8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S +++ b/src/mesa/drivers/dri/radeon/radeon_vtxtmp_x86.S @@ -492,3 +492,7 @@ GLOBL( _sse_MultiTexCoord2f_2 ) ret GLOBL( _sse_MultiTexCoord2f_2_end ) #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/glapi/gl_x86-64_asm.py b/src/mesa/glapi/gl_x86-64_asm.py index 20050ef3cf6..ea13d2ac522 100644 --- a/src/mesa/glapi/gl_x86-64_asm.py +++ b/src/mesa/glapi/gl_x86-64_asm.py @@ -190,6 +190,10 @@ class PrintGenericStubs(gl_XML.gl_print_base): print ' .long 2,4,20 /* Minimum kernel version w/TLS */' print '3: .p2align 2 /* pad out section */' print '#endif /* GLX_USE_TLS */' + print '' + print '#if defined (__ELF__) && defined (__linux__)' + print ' .section .note.GNU-stack,"",%progbits' + print '#endif' return diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py index e62687a7235..899cce64b99 100644 --- a/src/mesa/glapi/gl_x86_asm.py +++ b/src/mesa/glapi/gl_x86_asm.py @@ -188,6 +188,10 @@ class PrintGenericStubs(gl_XML.gl_print_base): print ' .long 2,4,20 /* Minimum kernel version w/TLS */' print '3: .p2align 2 /* pad out section */' print '#endif /* GLX_USE_TLS */' + print '' + print '#if defined (__ELF__) && defined (__linux__)' + print ' .section .note.GNU-stack,"",%progbits' + print '#endif' return diff --git a/src/mesa/tnl/t_vtx_x86_gcc.S b/src/mesa/tnl/t_vtx_x86_gcc.S index 5f79197f7e5..93753be759b 100644 --- a/src/mesa/tnl/t_vtx_x86_gcc.S +++ b/src/mesa/tnl/t_vtx_x86_gcc.S @@ -555,3 +555,7 @@ GLOBL( _tnl_x86_dispatch_vertexattribfv ) ret $8 /* return */ GLOBL( _tnl_x86_dispatch_vertexattribfv_end ) #endif /* defined (STDCALL_API) */ + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index 34433510c56..d976d53fe4b 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -31127,3 +31127,7 @@ GL_PREFIX(BlitFramebufferEXT): .long 2,4,20 /* Minimum kernel version w/TLS */ 3: .p2align 2 /* pad out section */ #endif /* GLX_USE_TLS */ + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86-64/xform4.S b/src/mesa/x86-64/xform4.S index 622c3f0c251..65328f6666e 100644 --- a/src/mesa/x86-64/xform4.S +++ b/src/mesa/x86-64/xform4.S @@ -1,4 +1,4 @@ -/* $Id: xform4.S,v 1.1 2005/05/07 16:59:59 brianp Exp $ */ +/* $Id: xform4.S,v 1.2 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -456,3 +456,7 @@ p4_2d_done: ret #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/3dnow_normal.S b/src/mesa/x86/3dnow_normal.S index 623849d80ce..4345c1b574e 100644 --- a/src/mesa/x86/3dnow_normal.S +++ b/src/mesa/x86/3dnow_normal.S @@ -1,4 +1,4 @@ -/* $Id: 3dnow_normal.S,v 1.9 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: 3dnow_normal.S,v 1.10 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -846,3 +846,7 @@ LLBL (G3R_end): RET #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/3dnow_xform1.S b/src/mesa/x86/3dnow_xform1.S index 57e66e94ab4..22b12cca067 100644 --- a/src/mesa/x86/3dnow_xform1.S +++ b/src/mesa/x86/3dnow_xform1.S @@ -1,4 +1,4 @@ -/* $Id: 3dnow_xform1.S,v 1.3 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: 3dnow_xform1.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -431,3 +431,7 @@ LLBL( G3TP3R_3 ): RET #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/3dnow_xform2.S b/src/mesa/x86/3dnow_xform2.S index 98c1522015d..d9e96d04e28 100644 --- a/src/mesa/x86/3dnow_xform2.S +++ b/src/mesa/x86/3dnow_xform2.S @@ -1,4 +1,4 @@ -/* $Id: 3dnow_xform2.S,v 1.3 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: 3dnow_xform2.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -471,3 +471,7 @@ LLBL( G3TPIR_4 ): POP_L ( ESI ) RET #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/3dnow_xform3.S b/src/mesa/x86/3dnow_xform3.S index bc6fd5a1c6d..babee1caa00 100644 --- a/src/mesa/x86/3dnow_xform3.S +++ b/src/mesa/x86/3dnow_xform3.S @@ -1,4 +1,4 @@ -/* $Id: 3dnow_xform3.S,v 1.4 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: 3dnow_xform3.S,v 1.5 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -555,3 +555,7 @@ LLBL( G3TPIR_2 ): POP_L ( ESI ) RET #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/3dnow_xform4.S b/src/mesa/x86/3dnow_xform4.S index b4336cd659a..b16d2b12dd6 100644 --- a/src/mesa/x86/3dnow_xform4.S +++ b/src/mesa/x86/3dnow_xform4.S @@ -1,4 +1,4 @@ -/* $Id: 3dnow_xform4.S,v 1.4 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: 3dnow_xform4.S,v 1.5 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -564,3 +564,7 @@ LLBL( G3TPIR_2 ): POP_L ( ESI ) RET #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/common_x86_asm.S b/src/mesa/x86/common_x86_asm.S index 654b3469d8a..ef3cc9eb59f 100644 --- a/src/mesa/x86/common_x86_asm.S +++ b/src/mesa/x86/common_x86_asm.S @@ -213,3 +213,7 @@ GLNAME( _mesa_test_os_sse_exception_support ): #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 1a46e5567e7..ed79797d321 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -1156,3 +1156,7 @@ GLNAME(gl_dispatch_functions_end): .long 2,4,20 /* Minimum kernel version w/TLS */ 3: .p2align 2 /* pad out section */ #endif /* GLX_USE_TLS */ + +#if defined(__ELF__) && defined(__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/mmx_blend.S b/src/mesa/x86/mmx_blend.S index f7326cdbe6b..397d635a621 100644 --- a/src/mesa/x86/mmx_blend.S +++ b/src/mesa/x86/mmx_blend.S @@ -364,3 +364,7 @@ TWO(MOVQ ( MM1, REGIND(rgba) )) #include "mmx_blendtmp.h" #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/read_rgba_span_x86.S b/src/mesa/x86/read_rgba_span_x86.S index 6b8036e5b8d..960cffa50bc 100644 --- a/src/mesa/x86/read_rgba_span_x86.S +++ b/src/mesa/x86/read_rgba_span_x86.S @@ -687,3 +687,7 @@ _generic_read_RGBA_span_RGB565_MMX: #endif ret #endif /* !defined(__DJGPP__) && !defined(__MINGW32__) */ + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/sse_normal.S b/src/mesa/x86/sse_normal.S index 07d831b8b69..066d46e5efd 100644 --- a/src/mesa/x86/sse_normal.S +++ b/src/mesa/x86/sse_normal.S @@ -1,4 +1,4 @@ -/* $Id: sse_normal.S,v 1.5 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: sse_normal.S,v 1.6 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -255,3 +255,7 @@ LLBL(K_G3TNNRR_finish): RET #undef FRAME_OFFSET #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/sse_xform1.S b/src/mesa/x86/sse_xform1.S index 1795c4cf86b..4051f606a7e 100644 --- a/src/mesa/x86/sse_xform1.S +++ b/src/mesa/x86/sse_xform1.S @@ -1,4 +1,4 @@ -/* $Id: sse_xform1.S,v 1.3 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: sse_xform1.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -440,3 +440,7 @@ LLBL(K_GTP13P3DR_finish): RET #undef FRAME_OFFSET #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/sse_xform2.S b/src/mesa/x86/sse_xform2.S index 9393668df02..06fe086bd40 100644 --- a/src/mesa/x86/sse_xform2.S +++ b/src/mesa/x86/sse_xform2.S @@ -1,4 +1,4 @@ -/* $Id: sse_xform2.S,v 1.3 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: sse_xform2.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -459,3 +459,7 @@ LLBL(K_GTP23P3DR_finish): RET #undef FRAME_OFFSET #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/sse_xform3.S b/src/mesa/x86/sse_xform3.S index db0b3cbfc5b..eafbe342887 100644 --- a/src/mesa/x86/sse_xform3.S +++ b/src/mesa/x86/sse_xform3.S @@ -1,4 +1,4 @@ -/* $Id: sse_xform3.S,v 1.3 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: sse_xform3.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -505,3 +505,7 @@ LLBL(K_GTP3P3DR_finish): RET #undef FRAME_OFFSET #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/sse_xform4.S b/src/mesa/x86/sse_xform4.S index aef62b00aa8..24c323194f1 100644 --- a/src/mesa/x86/sse_xform4.S +++ b/src/mesa/x86/sse_xform4.S @@ -1,4 +1,4 @@ -/* $Id: sse_xform4.S,v 1.3 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: sse_xform4.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -229,3 +229,7 @@ LLBL( sse_identity_done ): POP_L( ESI ) RET #endif + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/x86_cliptest.S b/src/mesa/x86/x86_cliptest.S index f4038a583ae..5a45ee6ae60 100644 --- a/src/mesa/x86/x86_cliptest.S +++ b/src/mesa/x86/x86_cliptest.S @@ -1,4 +1,4 @@ -/* $Id: x86_cliptest.S,v 1.11 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: x86_cliptest.S,v 1.12 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -401,3 +401,7 @@ LLBL(ctp4_np_finish): POP_L( ESI ) RET + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/x86_xform2.S b/src/mesa/x86/x86_xform2.S index bb255b48550..94f6989d423 100644 --- a/src/mesa/x86/x86_xform2.S +++ b/src/mesa/x86/x86_xform2.S @@ -1,4 +1,4 @@ -/* $Id: x86_xform2.S,v 1.3 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: x86_xform2.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -568,3 +568,7 @@ LLBL(x86_p2_ir_done): POP_L( ESI ) RET #undef FRAME_OFFSET + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/x86_xform3.S b/src/mesa/x86/x86_xform3.S index 6bdec6aa74f..747e2f4d286 100644 --- a/src/mesa/x86/x86_xform3.S +++ b/src/mesa/x86/x86_xform3.S @@ -1,4 +1,4 @@ -/* $Id: x86_xform3.S,v 1.3 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: x86_xform3.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -638,3 +638,7 @@ LLBL(x86_p3_ir_done): POP_L( EDI ) POP_L( ESI ) RET + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif diff --git a/src/mesa/x86/x86_xform4.S b/src/mesa/x86/x86_xform4.S index 61b303ad31b..def3c1ceb9e 100644 --- a/src/mesa/x86/x86_xform4.S +++ b/src/mesa/x86/x86_xform4.S @@ -1,4 +1,4 @@ -/* $Id: x86_xform4.S,v 1.3 2005/01/04 14:33:47 brianp Exp $ */ +/* $Id: x86_xform4.S,v 1.4 2006/04/17 18:58:24 krh Exp $ */ /* * Mesa 3-D graphics library @@ -671,3 +671,7 @@ LLBL(x86_p4_ir_done): POP_L( EDI ) POP_L( ESI ) RET + +#if defined (__ELF__) && defined (__linux__) + .section .note.GNU-stack,"",%progbits +#endif -- 2.30.2