[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Commands Reference, Volume 5

stripnm Command

Purpose

Displays the symbol information of a specified object file.

Syntax

stripnm [ -x ] [ -s ] File

Description

The stripnm command (when run without the -s flag) prints the symbol table of a specified object file to standard output. The file specified by the File parameter can be a single object file or an archive library of object files. If the file specified by the File parameter is an archive, a listing for each object file in the archive is produced. If the symbol table has been stripped from the object file, the stripnm command extracts symbol names from the traceback tables (even if the -s flag is not specified). If the traceback tables do not exist, an error message is displayed.

Note: The stripnm command does not list all symbols from the symbol table. Only file names and named and unnamed external symbols are reported. When used with the -s flag, the stripnm command will also suppress printing of some duplicated symbols in the symbol table.

Each symbol name is followed by its address (a series of blanks if the address is undefined) and the type of class and section type. The address field can be displayed as a decimal (the default value) or hexadecimal (if the -x flag is specified).

When run using the -s flag, the stripnm command extracts routine names first from the traceback tables and then from the symbol table, if it exists. Traceback tables are found at the end of routines, and contain the symbolic names of these routines. Routines defined as static do not appear in the symbol table, but may have traceback tables.

The stripnm command can also search for the glue code. The glue code is a set of executable instructions in the object file. In the Text section of the object file, the glue code is composed of the following sequence of instructions:

8182xxxx
xxxx is offset in the table of contents (TOC), and can be any string.
90410014
/* st r2, 14(r1) */
800c0000
/* 1 r0, 0(r12) 8*/
804c004
/* 1 r2, 4(r12) */
7c0903a6
/* mtctr r0 */
4e800420
/* bctr */

The stripnm command searches the Text section from beginning to end for this sequence. If the command finds a sequence of instructions that matches, it is reported as glue code.

The stripnm command can also be used to search for symbol information in the /unix file. If the /unix file does not correspond to the currently running kernel, a warning message is displayed.

Flags

-x
Prints symbol address values in hexadecimal format.
-s
If the symbol table does not exist, this flag displays symbol names from the traceback tables. If the symbol table exists, the -s flag first displays the symbol names from the traceback tables, and then displays symbol names found in the symbol table but not found in the traceback tables.

Examples

  1. To list the symbols of the a.out object file, enter:
    stripnm a.out
  2. To list the symbols address values of the a.out object file in hexadecimal mode, enter:
    stripnm -x a.out
  3. To list symbols from the traceback tables and symbol table (if it exists) of the a.out object file, enter:
    stripnm -s a.out

Related Information

The strip command.


[ Previous | Next | Contents | Glossary | Home | Search ]