Fixed an assembler warning / error (depending on the version of GAS used).
authorIan Romanick <idr@us.ibm.com>
Tue, 17 Aug 2004 17:03:24 +0000 (17:03 +0000)
committerIan Romanick <idr@us.ibm.com>
Tue, 17 Aug 2004 17:03:24 +0000 (17:03 +0000)
Fixed a crash in the optimized pthreads dispatch path.

src/mesa/glapi/gl_x86_asm.py
src/mesa/x86/glapi_x86.S

index cb2f6d5b209e9a3021b6f9fee7259cf6b61cbe9b..159925838cf703700335fe5397f3bc596666ae25 100644 (file)
@@ -72,7 +72,7 @@ class PrintGenericStubs(gl_XML.FilterGLAPISpecBase):
                print '#define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))'
                print ''
                print '#if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__)'
-               print '#define GLOBL_FN(x) GLOBL x ; .type x,@function'
+               print '#define GLOBL_FN(x) GLOBL x ; .type x, function'
                print '#else'
                print '#define GLOBL_FN(x) GLOBL x'
                print '#endif'
@@ -90,7 +90,7 @@ class PrintGenericStubs(gl_XML.FilterGLAPISpecBase):
                print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\'
                print '\tJE(1f) ;\t\t\t\t\t\\'
                print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\'
-               print '1:\tCALL(get_dispatch) ;\t\t\t\t\\'
+               print '1:\tCALL(_x86_get_dispatch) ;\t\t\t\\'
                print '\tJMP(GL_OFFSET(off))'
                print '#elif defined(THREADS)'
                print '#  define GL_STUB(fn,off,fn_alt)\t\t\t\\'
@@ -117,21 +117,13 @@ class PrintGenericStubs(gl_XML.FilterGLAPISpecBase):
                print '#ifdef PTHREADS'
                print 'EXTERN GLNAME(_glapi_Dispatch)'
                print 'EXTERN GLNAME(_gl_DispatchTSD)'
-               print '#ifdef __PIC__'
-               print 'EXTERN GLNAME(pthread_getspecific@PLT)'
-               print '#else'
                print 'EXTERN GLNAME(pthread_getspecific)'
-               print '#endif'
                print ''
                print 'ALIGNTEXT16'
-               print 'GLNAME(get_dispatch):'
+               print 'GLNAME(_x86_get_dispatch):'
                print '\tSUB_L(CONST(24), ESP)'
                print '\tPUSH_L(GLNAME(_gl_DispatchTSD))'
-               print '#ifdef __PIC__'
-               print '\tCALL(GLNAME(pthread_getspecific@PLT))'
-               print '#else'
                print '\tCALL(GLNAME(pthread_getspecific))'
-               print '#endif'
                print '\tADD_L(CONST(28), ESP)'
                print '\tRET'
                print '#elif defined(THREADS)'
index 4c8044e49cc400a08dd9d56483e7faa97b3a5ab0..6727e708c11465ebaca96e9f961e04f9d5ac9bb2 100644 (file)
@@ -42,7 +42,7 @@
 #define GL_OFFSET(x) CODEPTR(REGOFF(4 * x, EAX))
 
 #if defined(GNU_ASSEMBLER) && !defined(__DJGPP__) && !defined(__MINGW32__)
-#define GLOBL_FN(x) GLOBL x ; .type x,@function
+#define GLOBL_FN(x) GLOBL x ; .type x, function
 #else
 #define GLOBL_FN(x) GLOBL x
 #endif
@@ -60,7 +60,7 @@ GL_PREFIX(fn, fn_alt):                                        \
        TEST_L(EAX, EAX) ;                              \
        JE(1f) ;                                        \
        JMP(GL_OFFSET(off)) ;                           \
-1:     CALL(get_dispatch) ;                            \
+1:     CALL(_x86_get_dispatch) ;                       \
        JMP(GL_OFFSET(off))
 #elif defined(THREADS)
 #  define GL_STUB(fn,off,fn_alt)                       \
@@ -87,21 +87,13 @@ SEG_TEXT
 #ifdef PTHREADS
 EXTERN GLNAME(_glapi_Dispatch)
 EXTERN GLNAME(_gl_DispatchTSD)
-#ifdef __PIC__
-EXTERN GLNAME(pthread_getspecific@PLT)
-#else
 EXTERN GLNAME(pthread_getspecific)
-#endif
 
 ALIGNTEXT16
-GLNAME(get_dispatch):
+GLNAME(_x86_get_dispatch):
        SUB_L(CONST(24), ESP)
        PUSH_L(GLNAME(_gl_DispatchTSD))
-#ifdef __PIC__
-       CALL(GLNAME(pthread_getspecific@PLT))
-#else
        CALL(GLNAME(pthread_getspecific))
-#endif
        ADD_L(CONST(28), ESP)
        RET
 #elif defined(THREADS)