[uClibc] PowerPC Shared Library Problem

John Gordon jgordon at instant802.com
Fri Jun 18 00:23:26 UTC 2004


Hello all,

I am seeing error messages from our Kaffe port to PowerPC/uClibc which I 
don't see on other architectures we support in the same way (XScale & 
MIPS). The error is:

kaffe-bin: symbol '_dl_dprintf' is type R_PPC_REL24
         Compile shared libraries with -fPIC!

When I went digging in the binaries on the target system, I noticed that 
there were indeed a lot of R_PPC_REL24 relocation types in the 
libdl.so.0 which I was not expecting (there are none in any of the other 
libraries there).

Looking at the libdl-0.9.26.so file under ldso/libdl I do not see the 
same relocations, but then we generate minimal forms of all libraries 
for use on our runtime using mklibs. So, I took a look into that, and it 
is using the libdl_pic.a file for its modules, which is created as a 
symbolic link to the libdl.a file in the top level uClibc Makefile with 
this comment:

    # If we build shared libraries then the static libs are PIC...
    # Make _pic.a symlinks to make mklibs.py and similar tools happy.

Problem is that for libdl that is not true. The Makefile under 
ldso/libdl is compiling dlib.o without -fPIC always, and dlib_pic.o with 
-fPIC, and then generating two independent .a files (as well as the .so 
file).

The same thing is true for MIPS and ARM/XScale though, so I am left 
wondering whether this is a feature of the shared library support in the 
PowerPC specific code (which is where the error is generated) or whether 
it is a problem with the way that the library is installed (i.e. we 
should install the _pic version for real).

I will try a couple of things:

a) Get the latest PPC code (we are currently running 0.9.26) and see if 
that changes anything

b) Try building both libraries using -fPIC to see if that works

Any comments, suggestions or pointers though would be welcomed.

Thanks,
John...




More information about the uClibc mailing list