HP-UX Reference (11i v2 04/09) - 1 User Commands A-M (vol 1)

l
ld_pa(1) ld_pa(1)
(For PA-RISC Systems)
WARNINGS
ld recognizes several names as having special meanings. The symbol
_end is reserved by the linker to
refer to the first address beyond the end of the program’s address space. Similarly, the symbol
_edata
refers to the first address beyond the initialized data, and the symbol
_etext refers to the first address
beyond the program text. The symbols
end,
edata, and etext are also defined by the linker, but only
if the program contains a reference to these symbols and does not define them (see end(3C) for details).
On 32-bit, the symbol
__tdsize is the total thread local storage size required by the program or shared
library.
On 64-bit, the linker defines a few more symbols. The symbol
__TLS_SIZE is the total thread local
storage size. The symbol
_FPU_STATUS is the initial status of the FPU status register. The symbol
__SYSTEM_ID is the largest architecture revision level used by any compilation unit.
The linker treats a user definition of any of the symbols listed here as an error.
Through its options, the link editor gives users great flexibility. However, those who invoke the linker
directly must assume some added responsibilities. Input options should ensure the following properties
for programs:
• When the link editor is called through cc(1), a start-up routine is linked with the user’s program.
This routine calls exit(2) after execution of the main program. If users call
ld directly, they
must ensure that the program always calls
exit()
rather than falling through the end of the
entry routine.
• When linking for use with the symbolic debugger dde, the user must ensure that the program
contains a routine called
main. Also, the user must link in the file
/opt/langtools/lib/end.o
on 32-bit and /opt/langtools/lib/pa20_64/end.o
on 64-bit as the last file named on the command line.
There is no guarantee that the linker will pick up files from archive libraries and include them in the
final program in the same relative order that they occur within the library.
The linker emits warnings where ever it detects any compatibility issues. Among other things, these
issues include architectural ones, as well as functionality that may change over time. Some of these
include:
• Linking a PA 2.0 object file, which will not run on a PA 1.x system.
• Incremental loading with the
-A option.
• Procedure call parameter and return type checking, including the
-C option.
• Symbols with the same name but different types, such as CODE and DATA.
• Checking of unsatisfied symbols by the linker, which sometimes skips certain object files from an
archived library. This warning is only given if the
-v option is also provided.
• Versioning of objects within a shared library.
These messages can be turned off with the
+vnocompatwarnings option.
As noted in the Options section, certain options no longer exist in a 64-bit linker. They are:
•
-q
• -A
• -C
• -E
• -Q
• -S
• -T
• -X
• +dpv
Some restrictions exist for 64-bit mode with executables built with shared libraries and with S-bit set
(through +s enabled). The behavior of 64-bit executables does not match the behavior of equivalent 32-
bit executables or executables built with +compat. For any setuid or setgid programs, dld disables any
dynamic library searching through environment variables, SHLIB_PATH for 32-bit and 64-bit mode, and
LD_LIBRARY_PATH for 64-bit mode. If a library only exists in the directory specified in SHLIB_PATH
(or LD_LIBRARY_PATH), you get the runtime error "library not found" if the program is a setuid pro-
gram (that is, uid not equal to euid or gid not equal to eguid) and it depends on that library. dld uses
the dynamic path lookup (with SHLIB_PATH) only if the following conditions are satisfied: getuid
() == geteuid () && getgid () == getegid (). That is, if the uid or gid does not match its
HP-UX 11i Version 2: September 2004 − 19 − Hewlett-Packard Company Section 1−−487