do we need -fPIC for X11R6 modules

Paul Mackerras paulus at
Tue Oct 9 15:05:21 EST 2001

Kevin B. Hendricks writes:

> Quick question.  Should we be building X11R6 modules with -fPIC?  When I
> try, the resulting modules generate lots of unresolved symbols (like
> "fixup", etc).

I assume you mean XFree86 modules?

> What exactly are X11R6 modules?  Are they shared libraries?  If so, they
> should be built using -fPIC?  If they are not shared libraries, how are
> they "loaded" and "linked" in?

No, they are ordinary object files, which get loaded and linked into
the running XFree86 server process using linker code that is included
in the XFree86 server.  That is, the server mallocs some memory, reads
in the text and data and other stuff, processes the relocations, and
puts the symbols into its internal symbol table.

That means that for code in XFree86 to call a procedure in a module,
it has to do an explicit "lookup symbol" function call to get the
address of the procedure and then an indirect function call.

So no, we don't want -fPIC.  That introduces a whole new and different
set of relocations into the object file and I would be surprised if
the XFree86 loader knew how to deal with them.


** Sent via the linuxppc-dev mail list. See

More information about the Linuxppc-dev mailing list