public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* readelf.c (dynamic segment)
@ 2003-05-08 23:10 Filippos Papadopoulos
  2003-05-09  0:14 ` Daniel Jacobowitz
  0 siblings, 1 reply; 2+ messages in thread
From: Filippos Papadopoulos @ 2003-05-08 23:10 UTC (permalink / raw)
  To: binutils


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 !



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: readelf.c (dynamic segment)
  2003-05-08 23:10 readelf.c (dynamic segment) Filippos Papadopoulos
@ 2003-05-09  0:14 ` Daniel Jacobowitz
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Jacobowitz @ 2003-05-09  0:14 UTC (permalink / raw)
  To: Filippos Papadopoulos; +Cc: binutils

On Fri, May 09, 2003 at 02:10:10AM +0300, Filippos Papadopoulos wrote:
> 
> 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.

It doesn't "belong" to any particular library - it just serves as a
search path for all DT_NEEDED entries.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-09  0:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-08 23:10 readelf.c (dynamic segment) Filippos Papadopoulos
2003-05-09  0:14 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).