From 7cd8f0ef9d905080dc857c4739be9780b24a7fd2 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Wed, 10 Mar 2010 00:43:01 +0200 Subject: 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. --- src/mesa/glapi/glapi_getproc.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') 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, unsigned i; int offset = ~0; + init_glapi_relocs_once(); (void) memset( is_static, 0, sizeof( is_static ) ); (void) memset( entry, 0, sizeof( entry ) ); @@ -533,6 +534,8 @@ _glapi_get_proc_address(const char *funcName) _glapi_proc func; struct _glapi_function * entry; + init_glapi_relocs_once(); + #ifdef MANGLE /* skip the prefix on the name */ if (funcName[1] != 'g' || funcName[2] != 'l') -- cgit v1.2.3