100 Chapter 3
Linker Tasks
Linker Compatibility Warnings
Unsatisfied symbols found when linking to archive libraries — If you
specify the -v option with the +vallcompatwarnings option and
link to archive libraries, you may see new warnings. For an example,
see “Linking to Archive Libraries with Unsatisfied Symbols” in this
chapter.
Versioning within a shared library — If you do versioning within a
shared library with the HP_SHLIB_VERSION (C and C++); or the
SHLIB_VERSION (Fortran and Pascal) compiler directive, you should
migrate to the industry standard and faster-performing library-level
versioning. See “Library-Level Versioning” on page 150 to learn how
to do library-level versioning. In the HP-UX 11.00 release, the 64-bit
mode linker does not support internal library versioning.
Linking to Archive Libraries with UnsatisfiedSymbols
If you link a program that contains a reference to an archive library, and
the archive library contains an undefined symbol, you may see the
following warning:
ld: (Warning) The file library.a(x.o) has not been fully
checked for unsatisfied symbols. This behavior may
change in future releases.
The 32-bit mode linker does not include an object from an archive library
simply because it contains a needed definition of an uninitialized global
data symbol. Instead, it changes the existing undefined symbol to an
uninitialized data symbol. This symbol has the same size as the
definition of the global variable in the library.
For example, given these source files:
archive.c
int foo; /* definition of uninitialized
global data symbol */
void func()
{unsat();
}
main.c
extern int foo; /* declaration of global data symbol */
main()
{