Philip Blundell wrote:
>
> >Is there a way to determine if a .so has been built with
> >-fpic? Is it a performance problem to make -fpic the default?
>
> `objdump --dynamic-relocs | grep PC24' will tell you if there are any of the
> offending relocations in a shared object (if yes, chances are it was built
> without -fPIC). You wouldn't want to make -fpic the default for application
> code but for shared libraries that's the right thing to do.
There are two ways to get PC24 relocs into a shared library. One is to not
compile with -fPIC, the other is to link in object modules from a static
library compiled without -fPIC. It is quite often the latter which is the
cause.
The fix for ld.so requires upgrading glibc to 2.1.3. It is not available yet.
This version is not released yet, but should be in a couple of weeks. If you
are in a hurry you can build your own from the CVS tree on
sourceware.cygnus.com.
In the testing we have done here with this, this patch to ld.so is not as
effective as I might have hoped. The PC24 reloc is for a PC relative branch.
The offset must fit into 12 bits in the opcode. If the jump is too far, (ie:
exceeds the distance representable in 12 bits) the dynamic linker cannot fix up
the reloc, and the same error message results. This seems to be the case in a
large number of instances :{ .
The best way to fix this problem is to identify the offending modules, compile
them with -fPIC and relink.
Scott
--
Scott Bambrough - Software Engineer
REBEL.COM http://www.rebel.com
NetWinder http://www.netwinder.org
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]
++ Please use [EMAIL PROTECTED] for ++
++ kernel-related discussions. ++