Debugging Core Files Using HP WDB (5900-1573; WDB 6.2; January 2011)

Example 4 Viewing Symbol Information by Using the nm Command
This example illustrates the use of the nm command to display the symbol information for
the common linker and debugger symbols, Cerrno and Cselectdraw, on an HP 9000
system:
$ nm -x Cscreen_selection.o |grep Cerrno
Cerrno | |undef |data |
$ nm -x Cscreen_selection.o |grep Cselectdraw
Cselectdraw |0x00001178|extern|entry |$CODE$
The output of the nm command illustrates that the symbol, Cerrno is an undefined data
symbol and that the symbol, Cselectdraw is a function that is a code entry point.
Alternately, you can use odump -slexport, elfdump -n, or dynsym -s, instead
of nm to view the symbol definition for stripped binaries.
The dynamic symbols are not removed with the strip command. The strip -l
command only strips the line number tables.
What is a Stripped Binary?
The strip command removes the symbol table, debug information, and line number
information from the object file, including the archives. Thereafter, no symbolic debugging
access is available for the stripped object file.
The strip -l strips only the line table information, and the symbolic debugging access
continues to be available.
For more information on the strip command, see strip(1)
Stripped executables or shared libraries can also be built by using the -s compiler or
linker option.
In HP 9000 systems, the file command displays whether an executable is stripped or
not.
The following example illustrates the use of the file command before and after a strip
operation:
$ file a
a: PA-RISC1.1 shared executable dynamically linked -not stripped
$ strip a
$ file a
a: PA-RISC1.1 shared executable dynamically linked
In Integrity systems, you must use the nm to display whether the binary is stripped or not.
The output from the nm command displays 'no symbols' for a stripped binary on
Integrity systems.
What is a Stripped Binary? 17