LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-19-2010, 01:44 AM   #1
divyavyas
LQ Newbie
 
Registered: Oct 2010
Posts: 5
Blog Entries: 1

Rep: Reputation: 0
how does ldd command knows about depending shared objects


hi,

I would like to know how ldd command detects the depending shared object .
I have gone through /bin/ldd script but did not got anything.

I am new to linux .Please give me some idea.
 
Old 10-19-2010, 04:47 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
It probably reads the import table of the binary .. you may want to look at doco on the ELF file format

cheers
 
Old 10-20-2010, 09:00 AM   #3
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 676

Rep: Reputation: 137Reputation: 137
Quote:
Originally Posted by kbp View Post
It probably reads the import table of the binary .. you may want to look at doco on the ELF file format

cheers
No, ldd (on Linux) run executable in question with environment variable LD_TRACE_LOADED_OBJECTS set, and it tell to ld-linux not actually run the program, but only dump it's dependencies.

ldd is actually a script, so you can have a look yourself
 
1 members found this post helpful.
Old 10-20-2010, 09:37 AM   #4
wikapuki
Member
 
Registered: Jun 2009
Distribution: Debian
Posts: 80

Rep: Reputation: 15
Hi,

I am sure you meant as your posting read, but just incase you meant show me an example of how it works:

I use it to find out what library's are no longer installed after an update on my AMD64 which are needed for skype bit binary. SO I do the following:
ldd /usr/bin/skype | grep 'not found'

or without the filter:

ldd /usr/bin/skype
linux-gate.so.1 => (0xf77d7000)
libasound.so.2 => /usr/lib32/libasound.so.2 (0xf76ea000)
libXv.so.1 => /usr/lib32/libXv.so.1 (0xf76e5000)
libXss.so.1 => /usr/lib32/libXss.so.1 (0xf76e1000)
libSM.so.6 => /usr/lib32/libSM.so.6 (0xf76d9000)
libICE.so.6 => /usr/lib32/libICE.so.6 (0xf76c1000)
libXi.so.6 => /usr/lib32/libXi.so.6 (0xf76b4000)
libXrender.so.1 => /usr/lib32/libXrender.so.1 (0xf76ab000)
libXrandr.so.2 => /usr/lib32/libXrandr.so.2 (0xf76a4000)
libfreetype.so.6 => /usr/lib32/libfreetype.so.6 (0xf762c000)
libfontconfig.so.1 => /usr/lib32/libfontconfig.so.1 (0xf75fd000)
libXext.so.6 => /usr/lib32/libXext.so.6 (0xf75ee000)
libX11.so.6 => /usr/lib32/libX11.so.6 (0xf74d1000)
libz.so.1 => /usr/lib32/libz.so.1 (0xf74bc000)
libgthread-2.0.so.0 => /usr/lib32/libgthread-2.0.so.0 (0xf74b6000)
libglib-2.0.so.0 => /lib32/libglib-2.0.so.0 (0xf73ed000)
librt.so.1 => /lib32/librt.so.1 (0xf73e4000)
libdl.so.2 => /lib32/libdl.so.2 (0xf73e0000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf73c7000)
libstdc++.so.6 => /usr/lib32/libstdc++.so.6 (0xf72d2000)
libm.so.6 => /lib32/libm.so.6 (0xf72ab000)
libgcc_s.so.1 => /usr/lib32/libgcc_s.so.1 (0xf728d000)
libc.so.6 => /lib32/libc.so.6 (0xf7146000)
libuuid.so.1 => /lib32/libuuid.so.1 (0xf7142000)
libexpat.so.1 => /usr/lib32/libexpat.so.1 (0xf711c000)
libxcb.so.1 => /usr/lib32/libxcb.so.1 (0xf7102000)
libpcre.so.3 => /lib32/libpcre.so.3 (0xf70cf000)
/lib/ld-linux.so.2 (0xf77d8000)
libXau.so.6 => /usr/lib32/libXau.so.6 (0xf70cc000)
libXdmcp.so.6 => /usr/lib32/libXdmcp.so.6 (0xf70c7000)
 
Old 10-20-2010, 11:11 PM   #5
divyavyas
LQ Newbie
 
Registered: Oct 2010
Posts: 5

Original Poster
Blog Entries: 1

Rep: Reputation: 0
thanks............but my doubt is still there .........not able to visualize
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a shared memory and some shared objects in linux? jeremy28 Programming 6 06-11-2010 05:21 AM
[SOLVED] Shared libraries - ldd - cmov agrume Linux - Software 2 01-06-2010 05:02 PM
Shared Objects mohotmofine Programming 4 10-12-2009 05:46 PM
any links on linking, loading shared libraries, shared objects. etc? ananthbv Programming 0 02-03-2005 07:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration