[patch] xserver:dri

Alan Coopersmith Alan.Coopersmith at Sun.COM
Wed Feb 11 13:03:44 PST 2009


Adam Jackson wrote:
> The problem here is that noPanoramiXExtension is a data symbol.
> Function symbols can be resolved lazily by the runtime linker, because
> there's only one way in the ABI to call a symbol, so you can find all
> the call sites and patch them up to really call a resolver function.
> Data symbols, on the other hand, could be accessed any way you like,
> their addresses mangled by constant folding or any of the other
> optimizations the compiler will do, so there's really no way to fix them
> up after the fact.  So they have to resolve at dlopen time.

Seems like a saner solution would be to introduce a new public API,
such as:
	Bool dixExtensionPresent(const char *extname)
	{
		return (CheckExtension(extname) != NULL);
	}

and then stop exporting and checking the no*Extension symbols everywhere
(which always seem to make code harder to read due to the double negatives
 of checking for !noPanoramiXExtension and such).   As it is, every time
an extension is deleted or configured to not be built, it's technically
an ABI break if any module was checking for it.

(We could use the existing CheckExtension API, but I'd rather expose
 a boolean as part of the ABI than exposing the entire ExtensionEntry
 struct to callers that don't really need it.)

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



More information about the xorg-devel mailing list