[uClibc] Use GCC option -fPIC for shared objects
Benjamin ZORES
Benjamin.Zores at sxb.bsf.alcatel.fr
Thu Apr 29 13:51:27 UTC 2004
Hi there,
I'm currently developping a system based on PPC and using today's
uClibc snapshot.
My problem is the same that has already been reported there one year ago :
http://www.uclibc.org/lists/uclibc/2003-February/005756.html
Actually I've build the uClibc with my own gcc cross-compiler,
with CTOR_DTOR disabled, and -fPIC flag enabled, with support
for shared libs etc ...
My program is dynamically opening librairies via dlopen()
and report my the following error à lib's load :
~ # extractVar
Can't modify /usr/lib/mini_httpd/plugins/cpu.so's text section. Use GCC
option -fPIC for shared objects, please.
Nevertheless, the cpu.so lib is compiled using the following flags :
-fPIC
-Wl,-shared,-Bsymbolic,--dynamic-linker,/lib/ld-uClibc.so.0,-soname,cpu.so
So it means that nothing missing (hope I missed something :)
I've also noticed there :
http://www.uclibc.org/lists/uclibc/2002-April/003271.html
that libs compiled using the -fPIC flags should no more have the
R_PPC_REL24 type in the elf file.
But, according to elfreader :
bash-2.05b$ readelf -r plugins/cpu.so | grep R_PPC_REL24
00000768 00001f0a R_PPC_REL24 00000000 __uClibc_main + 0
It's the only one R_PPC_REL24 section that is still present using the
-fPIC flag.
Truely hope that someone can help me building this shared lib with no
more R_PPC_REL24 reference.
Best Regards,
Benjamin Zores
More information about the uClibc
mailing list