Operating System - Linux
1753886 Members
7177 Online
108809 Solutions
New Discussion

what hpux c functions require linking to a shared lib?

 
Iva Vukelja
New Member

what hpux c functions require linking to a shared lib?

Hi,

I've encountered a problem porting some code to HPUX. When linking
one of the executables, I get unresolved symbols shl_load, shl_unload
and shl_findsym. I found out on this forum that there are some
hpux calls that require you to link to a shared library (like
gethostbyname for instance), and that there's no way around it.
My program is supposed to run early at boot time, and I don't want to
depend on shared libs being around (I am using the '-Wl,-a archive'
option when linking).
I'm not using gethostbyname - but I guess there are other functions
on hpux that have the same requirement. I'd like to know what are they,
so that I can try to work around it.
Is there a list of those somewhere? Or how can I go about finding that
out?

Thanks,
Iva
1 REPLY 1
Dennis Handly
Acclaimed Contributor

Re: what hpux c functions require linking to a shared lib?

On IPF, libc is only shared.
On PA, there is usually a warning on the man page:
WARNINGS
Programs that use the interfaces described in this manpage cannot be
linked statically because the implementations of these functions
employ dynamic loading and linking of shared objects at run time.

Of course you could use nm -px libc.a and scan the unsats.