On Sun, Jan 18, 2004 at 06:10:27PM +1100, Andrew Bevitt wrote:
>Hello,
>
>Ive been looking into the module loaders available in XFree86 at the moment 
>elfloader, coffloader, aoutloader, and importantly dlloader. What Im trying 
>to do is establish a working XFree86 system under PaX which requires noexec 
>off the stack, as far as tests seem to go this appears to be suited to the  
>dlloader system.
>
>Im basically stuck on the symbol resolution for drivers and modules though ive 
>been looking at the elfloader code to try and establish an idea but the  
>stuctures for the modules are very different.
>
>If I have say a video driver which relies on the "xaa" module (the list of  
>REQUIRED symbols contains symbols from libxaa). How do I find the module that 
>those symbols exist in though without either  
>A) Specifying : Load "xaa" in XF86Config;
>B) Recursively loading every module until the symbol is resolved.
>
>Or does XFree86 automagically load each dependent module and then leave it to 
>the programmer to ensure proper listing order of the symbols so that each 
>symbol is accessable where needed?

The driver loads whatever modules it uses directly, and only when it
needs them (for example, the xaa module is typically loaded from the
driver with by calling: xf86LoadSubModule(pScrn, "xaa").  Also, a driver
would not load this module if the user has set the "NoAccel" option,
because it knows that it will never reference it in that case.  The
symbol lists are not a mandatory part of the loader mechanism.  They
are only there for sanity checking and debugging.

This scheme doesn't work with dlloader.  The current dlloader is only
useful for debugging purposes and for special cases (like the glide
driver) where an external shared library is needed.

Maybe dlloader could be rewritten to do the actual loading internally
instead of using system-provided dlopen()/dlsym(), and achieve the same
symbol resolution semantics as the other loaders.

Looking into this is on my todo list, but I'm interested in it more from
the point of view of allowing modules better access to interfaces provided
by external shared libraries.  If you want to follow it up, I'd suggest
using the patches I have for elfloader as a reference for the loader
semantics.  While some of the implementation details may change in future
revisions, the patches that I have available now show how elfloader
should work.  There is a link to the patches at
<http://www.x-oz.com/loader.html>.

David
-- 
David Dawes                                     X-Oz Technologies
www.XFree86.org/~dawes                          www.x-oz.com
_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to