[Mesa-dev] [PATCH] glx: Fix glXGetProcAddress() of global glX symbols post-automake conversion.

Jose Fonseca jfonseca at vmware.com
Wed Mar 21 07:44:18 PDT 2012


Ah yes. Good catch!

BTW, -Bsymbolic should be set probably for all shared libraries we produce. Otherwise it is an accident waiting to happen -- we don't want internal relocation to public symbols ever to be resolved elsewhere.

Jose

----- Original Message -----
> When a GL LD_PRELOAD library like apitrace was used,
> glXGetProcAddress() would return the preload's symbols instead of
> libGL's symbol, leading to infinite recursion when the returned
> function was called.  This didn't hit apitrace on most apps because
> who calls glXGetProcAddress() on the global functions.
> 
> The -Bsymbolic, which was present in mklib before automake
> conversion,
> causes the glxcmds.c:GLX_functions table to be resolved at link time,
> so that LD_PRELOADs don't affect it any more.
> 
> Fixes crashes when running wine under apitrace.
> ---
>  src/glx/Makefile.am |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
> index a11bd3f..2e06588 100644
> --- a/src/glx/Makefile.am
> +++ b/src/glx/Makefile.am
> @@ -101,6 +101,7 @@ GL_LIBS = \
>  	$(GL_LIB_DEPS)
>  
>  GL_LDFLAGS = \
> +	-Wl,-Bsymbolic \
>  	-version-number 1:2
>  
>  libGL_la_SOURCES = $(GL_FILES)
> --
> 1.7.9.1
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> 


More information about the mesa-dev mailing list