Operating System - HP-UX
1832919 Members
2755 Online
110048 Solutions
New Discussion

Re: Seemingly valid C libraries with no symbols

 
john doe_16
Occasional Contributor

Seemingly valid C libraries with no symbols

I've recentlty been working on some porting, so I've employed depot installs for my tools and some of the requirement libs. I've used depots from the HP-UX Porting Kit CDs and from the HP Porting Archives. I've had a problem with several of the shared libraries (*.sl) having no symbols, as reported by the linker and by nm.
The libraries are not zero byte and look valid, and the static libraries seem okey, but libs from both places have this problem. The main libs in question are: libz, libpng, libtiff, libungif, libjpeg. I manually got libz to build from source and it's compiled lib seems fine, but had serious trouble building PNG and JPEG, and I haven't tried building ungif from source yet....and frankly I don't care to spend my time working on the HP-UX port of JPEG and PNG, I'd much rather get to the stuff I actually want to port.

Has anyone seen this? Is it possibly a linker toolset problem that has a patch? I can't belive that both HP and the HPPA are distrubuting libraries that don't work.

Any help is appreciated.

benr.
3 REPLIES 3
Steven Gillard_2
Honored Contributor

Re: Seemingly valid C libraries with no symbols

Chances are you're looking at libraries that have had the symbol table stripped from them. The libraries can function fine without this information, it is really just there for debugging purposes, so you should still be able to link with them. See the strip(1) man page for more information.

This is common practice for proprietary software - it makes it more difficult for things to be reverse engineered. It also reduces the size of the binaries.

Regards,
Steve
Ollie R
Respected Contributor

Re: Seemingly valid C libraries with no symbols

Hi,

Yes, the compilation will have been done with the "-s" option - this is for both "gcc" and "cc".

I've successfully compiled "libpng" recently. What was your problem?

Ollie.
To err is human but to not award points is unforgivable
Mike Stroyan
Honored Contributor

Re: Seemingly valid C libraries with no symbols

There is a separate list of symbols used by shared libraries. It remains even when the symbols reported by nm have been stripped off. You can see the shared library symbol list for 32-bit PA-RISC libraries using
/usr/ccs/bin/odump -slexportlist libN.sl
for defined symbols and
/usr/ccs/bin/odump -slimportlist libN.sl
for wanted symbols. Some symbols will be both exported and imported. That means they are defined by the library but can be overridden by an earlier definition from a program or another library.

You can see the shared library symbol list for 64-bit PA-RISC libraries and IPF libraries using
elfdump -s -n .dynsym libN.sl
or
elfdump -s -n .dynsym libN.so