CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    137

    Question 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

  2. #2
    Join Date
    Feb 2004
    Location
    Canada
    Posts
    277

    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.

  3. #3
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    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).

  4. #4
    Join Date
    May 2005
    Posts
    99

    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.

  5. #5
    Join Date
    Jul 2005
    Posts
    52

    Question Re: which files are included in .so

    Quote 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?

  6. #6
    Join Date
    Oct 2000
    Location
    London, England
    Posts
    4,773

    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
  •  





Click Here to Expand Forum to Full Width

Featured