Re: Find out what symbols in dynamic library have not been compiled with -fPIC
On Wed, Dec 24, 2014 at 11:03:56PM +0100, Dmitry Katsubo wrote:
> Dear Debian developers,
>
> When trying to create a package that includes the library, I am reported
> the following error by lintian:
>
> E: libosra1: shlib-with-non-pic-code usr/lib/libosra.so
>
> I understand what the problem is about, but I would like to know which
> *functions* in resulting .so are not compiled without -fPIC.
>
> src$ readelf -d libosra.so | grep TEXTREL
> 0x00000016 (TEXTREL) 0x0
>
> What next? I need to see violating symbols e.g.
>
> 00153e5d 23 OBJECT WEAK DEFAULT 13 _ZTSN9OpenBabel9AliasData
> 00120dc0 295 FUNC GLOBAL DEFAULT 11 _ZN3UCS16to_nearest_digit
> 0011f260 277 FUNC GLOBAL DEFAULT 11 OCRAD_close
Install the elfutils package and use eu-findtextrel, it's sometimes
wrong, but it should get you started. The manual way to do this is to
crossreference the output of readelf -r with the symbol table and
readelf -l.
Mike
Reply to: