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

HP-UX Handbook Rev 13.00 Page 19 (of 101)
Chapter 11 Software Development
October 29, 2013
Name Value Scope Type Subspace
:
printf | 959288|extern|entry |
printf | 959328|extern|code |$CODE$
:
On IA:
Symbols from /usr/lib/hpux32/libc.so.1:
[Index] Value Size Type Bind O Shndx Name
:
[3318] | 268808160| 896|FUNC |WEAK |0| .text|fprintf
:
On PA, we find printf as exported symbol, just as we found main exported in HelloWorld.
On IA, we find printf as a .text symbol, just as we found main in HelloWorld.
Archive Bound Executables
The nm(1) and chatr(1) outputs for the archive bound program look different in many ways:
$ nm HelloWorld
On PA:
Symbols from HelloWorld:
Name Value Scope Type Subspace
:
main | 13232|extern|entry |$CODE$
:
printf | 14096|extern|entry |$CODE$
:
On PA, this time we see both main and printf defined in the program. This is because the linker
extracted the archive libc and linked the appropriate objects directly to the program. Also, we
see only one entry per symbol. This is because there is no need to access them from outside, so
no stubs are required here.
On IA, this example does not work, as there is no archived version of libc.so that is provided, but
for any function symbols that are imported, they should be of type “.text”.
On PA, consequently, the chatr(1) output will also look differently: