From edf07417be431ec36c340e21c6c4b6d51eb74363 Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 12 Jun 2007 09:47:03 -0600 Subject: Fix TEXREL issues when using GLX_USE_TLS (see bug 7459). --- src/mesa/glapi/gl_x86_asm.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/mesa/glapi/gl_x86_asm.py') diff --git a/src/mesa/glapi/gl_x86_asm.py b/src/mesa/glapi/gl_x86_asm.py index 650331a0c5a..403e87261b0 100644 --- a/src/mesa/glapi/gl_x86_asm.py +++ b/src/mesa/glapi/gl_x86_asm.py @@ -82,12 +82,18 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '' print '#ifdef GLX_USE_TLS' print '' + print '#ifdef GLX_X86_READONLY_TEXT' + print '# define CTX_INSNS MOV_L(GS:(EAX), EAX)' + print '#else' + print '# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */' + print '#endif' + print '' print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' print 'ALIGNTEXT16;\t\t\t\t\t\t\\' print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' print '\tCALL(_x86_get_dispatch) ;\t\t\t\\' - print '\tNOP ;\t\t\t\t\t\t\\' + print '\tCTX_INSNS ; \\' print '\tJMP(GL_OFFSET(off))' print '' print '#elif defined(PTHREADS)' @@ -138,7 +144,10 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '\tHIDDEN(GLNAME(_x86_get_dispatch))' print 'ALIGNTEXT16' print 'GLNAME(_x86_get_dispatch):' - print '\tmovl\t%gs:_glapi_tls_Dispatch@NTPOFF, %eax' + print '\tcall 1f' + print '1:\tpopl %eax' + print '\taddl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax' + print '\tmovl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax' print '\tret' print '' print '#elif defined(PTHREADS)' @@ -158,7 +167,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print '#endif' print '' - print '#if defined( GLX_USE_TLS )' + print '#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )' print '\t\t.section\twtext, "awx", @progbits' print '#endif /* defined( GLX_USE_TLS ) */' -- cgit v1.2.3