HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 17 (of 101)
Chapter 11 Software Development
October 29, 2013
main | 10400|extern|code |$CODE$
:
printf | |undef |code |
printf | 10384|uext |stub |
:
On IA:
Symbols from HelloWorld:
[Index] Value Size Type Bind O Shndx Name
:
[59] | 67110992| 112|FUNC |GLOB |0| .text|main
[42] | 270842400| 0|FUNC |WEAK |0| UNDEF|printf
$
nm(1) shows a lot of symbols in the executable. Most of them are from crt0.o. The interesting
ones from the programmer’s point of view are main and printf.
On PA, there are two entries for each symbol in shared libraries and programs. One describes the
symbol itself, the other is the so called stub that provides access to the symbol from external.
"extern|entry" and "extern|code" are typical for exported symbols, "undef |code" for
imported ones. printf is an imported symbol.
On IA, there is only one entry for each symbol. It describes main as a global function that is
contained in the executable the “.text” reference and printf as an undefined function symbol.
The chatr(1) command shows the library references of the program:
$ chatr HelloWorld
On PA:
HelloWorld:
shared executable
shared library dynamic path search:
SHLIB_PATH disabled second
embedded path disabled first Not Defined
shared library list:
dynamic /usr/lib/libc.2
shared library binding:
deferred
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled