[PATCH] Prefer locally defined symbols in modules

Alan Coopersmith Alan.Coopersmith at Sun.COM
Tue Sep 8 09:03:30 PDT 2009


I don't see RTLD_DEEPBIND on Solaris, so we'd need some #ifdef's there -
the closest match I seen in our dlopen() man page would be to turn off
DLOPEN_GLOBAL and use _LOCAL instead, though using the direct binding
option to the linker when building the .so's would help.

I agree that limiting exported symbols by default seems the best long
term answer - for most modules, don't they just need to export the
ModuleData object and the function listed in it to call for initialization?

	-alan-

Matthias Hopf wrote:
> As multiple driver modules are loaded now on startup time (even if they
> aren't actually used) we get something now that has not really been a
> problem so far:
> 
>   Name clashes.
> 
> We at SUSE additionally load radeonhd and radeon, and there the clashes
> are most severe - I found 167 name clashes, which result in certain
> death on r4xx cards with AtomBIOS, because some AtomBIOS routines from
> radeonhd are called from the radeon driver, which have the same name but
> subtly different semantics. Or values from tables from the one driver
> are used with functions of the other. You get the picture.
> 
> The attached patch solves this issue on Linux - it uses RTLD_DEEPBIND
> which is unfortunately not POSIX.1-2001 compatible.
> Should this be added according to compile-time tests, or is there
> another equivalent solution?
> 
> In the long term, explicitly exported symbols would probably be the
> right way to go.
> 
> Matthias
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> xorg-devel mailing list
> xorg-devel at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-devel

-- 
	-Alan Coopersmith-           alan.coopersmith at sun.com
	 Sun Microsystems, Inc. - X Window System Engineering



More information about the xorg-devel mailing list