Displays the symbol information of a specified object file.
stripnm [ -x | -d ] [ -s ] [ -z ] File
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) and the loader section of the object file(s). If the traceback tables do not exist, an error message is displayed.
Each symbol name is preceeded by its address and one character representing the symbol type (similar to nm output). When used with -z, the output format is the same as it was before AIX 5.2, that is 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 with -z, or when -d is used) or hexadecimal (the default value without -z, or if the -x flag is used).
Source file names are also collected and reported by the stripnm command. All the symbols following a source file name line belongs to the same source file, until the next source file name line is encountered. For stripped files, the source file name is reported as being the object file name.
When run using the -s flag, the stripnm command ignores the symbol table if present and always extracts routine names from the traceback tables and the loader section of the object file(s).
When no symbol table is present or the -s flag is used, the stripnm command also searches for glue code and pointer glue information. Both are sequences of instructions found in the text section of the object file.
The glue code for 32 bit applications is composed of the following sequences of instructions:
8182xxxx # lwz r12,xxxx(r12) (xxxx is the TOC entry index) 90410014 # stw r2,14(r1) 800c0000 # lwz r0,0(r12) 804c0004 # lwz r2,4(r12) 7c0903a6 # mtctr r0 4e800420 # bctr
The loader section entry whose address matches the TOC entry pointed to by xxxx gives the function name for this sequence of glue code.
For 64 bit executables, the glue code sequences are as follows:
982xxxx # ld r12,xxxx(r2) (xxxx is the TOC entry index) 8410028 # std r2,28(r1) 80c0000 # ld r0,0(r12) 84c0008 # ld r2,8(r12 c0903a6 # mtctr r0 e800420 # bctr
The pointer glue code for 32 bit applications is composed of the following sequence:
800b0000 # lwz r0,0(r11) 90410014 # stw r2,20(r1) 7c0903a6 # mtctr r0 804b0004 # lwz r2,4(r11) 816b0008 # lwz r11,8(r11) 4e80xx20 # bctr
For 64bit executables, the pointer glue code sequence is as follows:
e80b0000 # ld r0,0(r11) f8410028 # std r2,20(r1) 7c0903a6 # mtctr r0 e84b0008 # ld r2,8(r11) e96b0010 # ld r11,16(r11) 4e80xx20 # bctr
Pointer glue exists only in one copy and is always reported as symbol ._prtgl.
The stripnm command searches the Text section from beginning to end for these sequences. If the command finds a sequence of instructions that matches, it is reported as glue code or pointer glue.
Source file symbols are generated artificially by stripnm for both glue code and pointer glue. For 32 bit executables, the source file is glink.s for all glue code entries, and ptrgl.s, for the pointer glue. For 64 bit executables, the source files are repectively glink64.s and ptrgl_64.s.
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 displays.
stripnm a.out
stripnm -d a.out
stripnm -xz libc.a
The strip command.