Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Linker and Libraries User's Guide: HP 9000 Computers > Chapter 3 Linker Tasks

Linker Compatibility Warnings

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Beginning with the HP-UX 10.20 release, the linker generates compatibility warnings. These warnings include HP 9000 architecture issues, as well as linker features that may change over time. Compatibility warnings can be turned off with the +vnocompatwarnings linker option. Also, detailed warnings can be turned on with the +vallcompatwarnings linker option. See the ld(1) man page for a description of these options.

Link-time compatibility warnings include the following:

  • Linking PA-RISC 2.0 object files on any system — PA-RISC 1.0 programs run on 1.1 and 2.0 systems. PA-RISC 2.0 programs do not run on 1.1 or 1.0 systems. See Also “PA-RISC Changes in Hardware Compatibility ”.

  • Dynamic linking with -A — If you do dynamic linking with -A, you should migrate to using the shared library management routines described in Chapter 6 “Shared Library Management Routines ”. These routines are also described in the sh_load(3X) and dl*(3X) man page.

    The 64-bit mode linker does not support the -A option.

  • Procedure call parameter and return type checking (which can be specified with -C) — The 32-bit linker checks the number and types of parameters in procedure calls across object modules. In a future release, you should expect HP compilers to perform cross-module type checking, instead of the linker. This impacts HP Pascal and HP Fortran programs.

    The 64-bit mode linker does not support the -C option.

  • Duplicate names found for code and data symbols — The 32-bit linker can create a program that has a code and data symbol with the same name. In the HP-UX 11.00 release, the 64-bit mode linker adopts a single name space for all symbols. This means that code and data symbols cannot share the same name. Renaming the conflicting symbols solves this problem.

  • 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 ” 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 Unsatisfied Symbols

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()
{
printf ("\tfoo = %d\n", foo);
}

If these files are compiled and linked as:

cc -c main.c
cc -c archive.c
ar rv liba.a archive.o
ld /opt/langtools/lib/crt0.o -v \
+vallcompatwarnings main.o liba.a -lc -o test

The linker issues the following warning:

ld: (Warning) The file liba.a(archive.o) has not been fully
checked for unsatisfied symbols. This behavior may change
in future releases.

due to an unresolved symbol for unsat().

In the HP-UX 11.00 release, the linker includes the archive library object definition rather than fixing up the external reference.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997 Hewlett-Packard Development Company, L.P.