|
-
July 13th, 2005, 08:12 AM
#1
which files are included in .so
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
-
July 13th, 2005, 02:16 PM
#2
Re: which files are included in .so
I seriously doubt (I don't want to say no for sure) that's possible if it is built without debug info.
Latem
Being a pessimist is wonderful; you are either proven right, or pleasantly surprised.
-
July 13th, 2005, 05:48 PM
#3
Re: which files are included in .so
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).
-
July 13th, 2005, 11:28 PM
#4
Re: which files are included in .so
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.
-
July 14th, 2005, 04:49 AM
#5
Re: which files are included in .so
 Originally Posted by NMTop40
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?
-
July 14th, 2005, 05:03 AM
#6
Re: which files are included in .so
__FILE__ is a pre-processor macro which expands to the file name.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|