This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
readelf.c (dynamic segment)
- From: Filippos Papadopoulos <csst9923 at cs dot uoi dot gr>
- To: binutils at sources dot redhat dot com
- Date: Fri, 9 May 2003 02:10:10 +0300 (EEST)
- Subject: readelf.c (dynamic segment)
Hi.
Looking in readelf.c source i found that the function
'process_dynamic_segment' provides me the names of the shared libraries
that are 'NEEDED'. As i have understood 'readelf' can provide only the name of the
'NEEDED' libraries, not their full path. So to find the full path i use
the list of directories and libraries stored in the current
dynamic linker cache. I use '/sbin/ldconfig -p' for that.
The problem is that not all libraries are listed in the cache. For
example i found that the library 'konqueror.so' , on KDE 3, is not listed.
But i think that 'konqueror.so' has stored its full path in the rpath
field. My question is how to obtain the rpath of a library's name without
knowing where it resides? I found that by running 'readelf -d
/opt/kde3/bin/konqueror' the output lists an rpath entry(/opt/kde3/lib/).
But how can i tell that this rpath "belongs" to 'konqueror.so' and not to
any other listed 'NEEDED' library ?
As i am a bit newbie to ELF structures, and as the code of readelf.c is
tricky, i don't know where that info is in the readelf's source.
Thanks !