LinuxQuestions.org
Review your favorite Linux distribution.
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


Closed Thread
  Search this Thread
Old 03-12-2019, 09:45 AM   #1
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Rep: Reputation: 12
How to identify library used by GCC linker ?


I am trying to use Linux command, hence my question is posted here, to physically verify / identify library used by GCC linker.
I have looked at GCC linker verbose output and it really does not tell me much, only that library "bluetooth" is set as "l" liked option - lbluetooth.

This syntax shows all object files associated with "bluetooth":
Quote:
jim@jim-desktop:~$ ldconfig -p | grep "bluetooth"

jim@jim-desktop:~$ ldconfig -p | grep "bluetooth"
libgnome-bluetooth.so.13 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libgnome-bluetooth.so.13
libbluetooth.so.3 (libc6,x86-64) => /usr/local/lib/libbluetooth.so.3
libbluetooth.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libbluetooth.so.3
libbluetooth.so.3 (libc6,x86-64) => /usr/lib/libbluetooth.so.3
libbluetooth.so.3 (libc6) => /usr/lib/i386-linux-gnu/libbluetooth.so.3
libbluetooth.so (libc6,x86-64) => /usr/local/lib/libbluetooth.so
libbluetooth.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libbluetooth.so
libbluetooth.so (libc6,x86-64) => /usr/lib/libbluetooth.so


Is there an option to narrow down the ldconfig / grep to be able to retrieve only file(s) associated with the application ?
 
Old 03-12-2019, 09:50 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,098

Rep: Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143
probably you need to command ldd
 
Old 03-13-2019, 12:00 PM   #3
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Use linker -Wl,-Map=myfile.map option
 
Old 03-13-2019, 12:10 PM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,098

Rep: Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143Reputation: 4143
can you show me an example? How does it work?
 
Old 03-13-2019, 01:26 PM   #5
AnneRanch
Member
 
Registered: Oct 2018
Posts: 198

Original Poster
Rep: Reputation: 12
Quote:
Originally Posted by pan64 View Post
can you show me an example? How does it work?
Example?
Not really , just added the option to the linker.
It creates the named file.
It is pretty big and I have not analysed it in its entirety, just part.
But I now know the exact library x.so files linked to the application.
I may eventually have to rename them...
 
  


Closed Thread

Tags
ldconfig


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
LXer: Identify PCI and USB Wired and Wireless Driver in Linux Identify PCI Driver. Ubuntu, Debian, LXer Syndicated Linux News 0 08-20-2014 07:21 AM
tiff library - linker error nimra Programming 3 10-08-2011 03:54 AM
[SOLVED] cryptic linker error (i really dont like linker errors); smeezekitty Programming 2 09-19-2009 02:21 AM
How to read "identify" button press event, or state of "identify" blue led with IPMI? iav Linux - Server 0 01-27-2009 01:13 PM
A linker problem with a couple of library needed by VirtualBox crisostomo_enrico Solaris / OpenSolaris 4 09-14-2008 06:43 PM

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

All times are GMT -5. The time now is 12:35 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration