Enforcing server and API in a dlloader world

Daniel Stone daniel at fooishbar.org
Mon May 23 03:43:35 PDT 2005


On Mon, May 23, 2005 at 12:27:41PM +0200, Egbert Eich wrote:
> So far the module loader has had the policy to only expose those symbols 
> from the core part of the server to modules that where specified in the 
> sym-files you have mentioned while it exposed any symbol inside a module 
> that was non-static to every other module. 

You achieve this with dlopen by opening with RTLD_GLOBAL.

> It would be nice if we could preserve the former behavior so that we
> would be able to keep the symbols to export from the core in a single 
> place while we come up with a more restrictive behavior than the
> latter one.
> 
> If we could turn the list of symbols into a map file while we use the
> apporach of specifying the symbols to export inside the code itself
> for the modules we have a solution which would preserve as much as
> possible of the resent behavior.

The only real way to achieve this would be to generate a custom linker
script from xf86sym.c, which is pretty nasty.  I also don't know how
portable linker scripts are.

Surely the best thing to do would just be to have someone sit down and
manually mark all the symbols in xf86sym.c, dixsym.c, fontsym.c and
friends X_VISIBLE (or whatever it is), and then we could build with
-fvisibility=hidden?  This takes us back to the old elfloader
behaviour, where people were required to manually export symbols.  It
also prevents any 'accidental' exposing of symbols: only the ones
people want to be visible will be visible.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg/attachments/20050523/43210a0b/attachment.pgp>


More information about the xorg mailing list