LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to identify library used by GCC linker ? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-identify-library-used-by-gcc-linker-4175650020/)

AnneRanch 03-12-2019 09:45 AM

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 ?

pan64 03-12-2019 09:50 AM

probably you need to command ldd

AnneRanch 03-13-2019 12:00 PM

Use linker -Wl,-Map=myfile.map option

pan64 03-13-2019 12:10 PM

can you show me an example? How does it work?

AnneRanch 03-13-2019 01:26 PM

Quote:

Originally Posted by pan64 (Post 5973453)
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...


All times are GMT -5. The time now is 07:23 PM.