How to list members of a shared library - HP UX

This is a discussion on How to list members of a shared library - HP UX ; I have a file with extension .sl on HP-UX and extension .so on Linux. How do I list the members of a shared library? Are shared libraries needed at compile time, run time, or both? Using the ld command to ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to list members of a shared library

  1. How to list members of a shared library

    I have a file with extension .sl on HP-UX and extension .so on Linux.
    How do I list the members of a shared library?

    Are shared libraries needed at compile time, run time, or both?

    Using the ld command to create the shared libraries, I use -b on HP-UX
    and -shared on Linux. Is this correct, or do I need something more?

    Thanks,
    Dan McKinley
    McKINLDJ@westinghouse.com


  2. Re: How to list members of a shared library

    On Thu, 13 Jul 2006 08:58:22 -0700, McKinldj wrote:

    > I have a file with extension .sl on HP-UX and extension .so on Linux.
    > How do I list the members of a shared library?
    >


    nm -o libfoobar.so


    > Are shared libraries needed at compile time, run time, or both?
    >


    both

    > Using the ld command to create the shared libraries, I use -b on HP-UX
    > and -shared on Linux. Is this correct, or do I need something more?
    >


    This is how I create a shared library in Linux (in a makefile, but with
    the obvious changes you can run it at the prompt):


    libfoobar.so: $(OBJECTS)
    g++ -shared -W1,soname,$@ -o $@ $^

    ($@ stands for the target libfoobar.so and $^ expands to the dependencies
    following the target).

    Because it's a shared library, the linker must be told about it, so you
    must run (as root):

    /sbin/ldconfig /path/to/lib/ # containing libfoobar.so


    All this is in linux, with gnu make, etc.


+ Reply to Thread