Operating System - HP-UX
1833877 Members
1623 Online
110063 Solutions
New Discussion

problem with dynamic shared libraries

 
SOLVED
Go to solution
Ravi banka_1
New Member

problem with dynamic shared libraries

This is my first post so a big "Hello to all"

Problem:
I am creating a dynamic library on HPUX IPF 11.23 with lhe following link options (linker ld HP Itanium(R) B.12.34 IPF/IPF):

>> ld -G -B symbolic -b +s

I am not able to see any exported symbols from this library using the nm command -
nm: no symbols

The same command is used to link a library on a HP Pa system and it seems to work fine with nm giving a huge listing for library.

My executables on IPF seem to be having some problems which I suspect has something to do with the symbols not getting exported from by library. I am linking my executable with the following options " cc -Wl,+s -Wl,+n +DD64 -o"


Please give me some advice?

3 REPLIES 3
Dennis Handly
Acclaimed Contributor
Solution

Re: problem with dynamic shared libraries

>I am not able to see any exported symbols from this library using the nm command: ld -G -B symbolic -b +s

nm is the wrong command to look at shared libs. You should be using elfdump -t, in my case this shows the symbols.

You have found a bug in -G, so just remove it. (The bug is still there on B.12.41.) If you want to strip debug info, use strip -l.

Ravi banka_1
New Member

Re: problem with dynamic shared libraries

Thanks Dennis.

"elfdump -t" does work great.

>>You have found a bug in -G
Can you please help me understand what bug you meant here?
Dennis Handly
Acclaimed Contributor

Re: problem with dynamic shared libraries

>Can you please help me understand what bug you meant here?

That -G strips the symbol table instead of just the unloadable debug info. That should only be done with -s.