summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsapountzis@gmail.com>2010-03-10 00:43:01 +0200
committerGeorge Sapountzis <gsapountzis@gmail.com>2010-03-10 18:44:47 +0200
commit7cd8f0ef9d905080dc857c4739be9780b24a7fd2 (patch)
tree1164ea5adb38f45f8333127136e50b4cb31f8616
parentbae31355150f66f7130d76a2ab4d4b735f239c71 (diff)
glapi: fix bug with tls and relocs
add_dispatch (driver) and maybe get_proc_address (client) may be called before set_dispatch is called, which results in generate_entrypoint using an unreloced function template.
-rw-r--r--src/mesa/glapi/glapi_getproc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/glapi/glapi_getproc.c b/src/mesa/glapi/glapi_getproc.c
index 5a8c6953ac2..295657875dc 100644
--- a/src/mesa/glapi/glapi_getproc.c
+++ b/src/mesa/glapi/glapi_getproc.c
@@ -405,6 +405,7 @@ _glapi_add_dispatch( const char * const * function_names,
405 unsigned i; 405 unsigned i;
406 int offset = ~0; 406 int offset = ~0;
407 407
408 init_glapi_relocs_once();
408 409
409 (void) memset( is_static, 0, sizeof( is_static ) ); 410 (void) memset( is_static, 0, sizeof( is_static ) );
410 (void) memset( entry, 0, sizeof( entry ) ); 411 (void) memset( entry, 0, sizeof( entry ) );
@@ -533,6 +534,8 @@ _glapi_get_proc_address(const char *funcName)
533 _glapi_proc func; 534 _glapi_proc func;
534 struct _glapi_function * entry; 535 struct _glapi_function * entry;
535 536
537 init_glapi_relocs_once();
538
536#ifdef MANGLE 539#ifdef MANGLE
537 /* skip the prefix on the name */ 540 /* skip the prefix on the name */
538 if (funcName[1] != 'g' || funcName[2] != 'l') 541 if (funcName[1] != 'g' || funcName[2] != 'l')