Click to See Complete Forum and Search --> : which files are included in .so
bashish
July 13th, 2005, 08:12 AM
Hi,
Is there any way to find out which all files are included in a .so files. I want only listing nothing else.
For example
If xyz.so is created with a.c, b.c, a.h then if I have only xyz.so it should tell me that a.c, b.c, a.h are the files.
bashish
Latem
July 13th, 2005, 02:16 PM
I seriously doubt (I don't want to say no for sure) that's possible if it is built without debug info.
Latem
NMTop40
July 13th, 2005, 05:48 PM
Not from existing .so files.
But in your own files you can add a macro to every file that submits __FILE__ to a std::set< std::string > and have a method in your .so to list them out. (Beware that neither std::set nor std::string are portable though. There are ways around that though).
manish_velankani
July 13th, 2005, 11:28 PM
There is no way but one indirect way to do so. If you are working with gcc on unix/solaris then you can use ldd command on .so files to list out all the libraries it is using.
There is one more command "nm -AC <.so filename>". This will give you a list of object files included in .so. Also it will give you all symbols present in .so and the name of object file the symbol has been included from.
swapnil_paranjape
July 14th, 2005, 04:49 AM
Not from existing .so files.
But in your own files you can add a macro to every file that submits __FILE__ to a std::set< std::string > and have a method in your .so to list them out. (Beware that neither std::set nor std::string are portable though. There are ways around that though).
what is this __FILE__?? can u please explain in more detail?
NMTop40
July 14th, 2005, 05:03 AM
__FILE__ is a pre-processor macro which expands to the file name.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.