Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ar(1)

a.out(5)

ar(5)

NM(1)  —  Series 500 Implementation

NAME

nm − print name list (symbol table) of object file

SYNOPSIS

nm [ −gnopru ] [ file ... ]

HP-UX COMPATIBILITY

Level: HP-UX/STANDARD

Origin: System III

Remarks: This manual page describes nm as implemented on the Series 500 computers.  Refer to other nm manual pages for information valid for other implementations. 

DESCRIPTION

Nm prints the name list (symbol table) of each object file in the argument list.  If an argument is an archive, a listing for each object file in the archive will be produced, preceded by the member name on a separate line.  If no file is given, the symbols in a.out are listed. 

Options are:

−g Print only global (external) symbols. 

−n Sort numerically rather than alphabetically. 

−o Prepend file or archive element name to each output line rather than only once.  This option can be used to make piping to grep(1) more meaningful.

−p Don’t sort; print in symbol-table order. 

−r Sort in reverse order. 

−u Print only undefined symbols. 

The output from nm consists of five columns of data.  The following is a portion of a typical output:

.XIDATA00000108A_iob
.XIDATA000002a0A_sctab
.XICOMM00000400 0 00000440A_sibuf
.XICOMM00000400 0 00000840A_sobuf
..UDATA00000c40Aallocs
.XFUNCEDS c04 002a8 00000003__cleanup
.XDDATADR 00000098__ctype
.XFUNCEDS c0c 00000 00000001__doscan
.XSYSTEMEPP 004 0000e__exit
.XDDATADR 00000038__iob
.XDCOMM00000004 000000b0__pfile
.XDDATADR 00000090__sctab
.XPTR1 00000a 000000b4__sibuf
.XPTR1 00000c 000000b8__sobuf
..FILENAME0000000a_exit.o
..FILENAME0000000f_print.o

>From left to right, the first column specifies whether the symbol is defined (.) or undefined (U).  The second column specifies whether the symbol is non-external (.) or external (X).  The third column gives the linker symbol type (as defined in a.out.h and described below).  The fourth column lists the data associated with the specified symbol type.  The fifth column gives the name of the system call, file, variable, array, common, etc., described by that entry in the symbol table. 

Up to four data elements are reported in the fourth column.  If they are not symbolic values (such as ‘EDS’ or ‘DR’), then they are hexadecimal values.  The number of data elements reported depends on the symbol type.  Each symbol type has one to four parameters associated with it, whose values are given by the data elements in the fourth column.  The symbol types and associated parameters are discussed below. 

The following symbol types are supported:

ABS not currently generated; reserved for future use. 

FUNC or ENTRY specifies that the entry refers to a function or procedure call.  Four numbers, ptr_type, segment, offset, and stt_index, are associated.  Their values are given in order, from left to right, by the data elements.  Ptr_type consists of a single bit that is always cleared.  It is symbolically represented by ‘EDS’.  Ptr_type is meaningful to the linker (see ld(1)), and specifies the storage format of the call in the symbol table.  Segment specifies the code segment number (a number in the range 3073 to 4095, that indicates which code segment in the user’s program space contains the desired code).  Offset specifies the number of bytes from the beginning of the code segment where the function or procedure code begins.  Stt_index is an indirect reference to the beginning of the function or procedure code. 

SYSTEM specifies that the entry refers to a procedure call directly into the system kernel.  Three numbers, entry_type, segment, and stt, are associated.  Their values are given by the data elements.  Entry_type consists of a single bit that is always set.  Its value is symbolically represented by ‘EPP’.  Entry_type is meaningful to the linker, and specifies the storage format of the call in the symbol table.  Segment specifies the system code segment number (the number of a code segment among those set aside for system use; typically in the range 0 to 64).  Stt is an indirect pointer to the beginning of the procedure code. 

LABEL specifies that the entry is the destination address for a branch instruction.  Three numbers, ptr_type, segment, and offset, are associated.  Their values are given by the data elements.  Ptr_type consists of a single bit which is always cleared.  Its value is symbolically represented by ‘EDS’.  Ptr_type is meaningful to the linker, and specifies the storage format of the address in the symbol table.  Segment specifies the user code segment number.  Offset specifies the number of bytes from the beginning of the code segment where the label begins. 

DDATA specifies that the entry is a directly-addressable, initialized data structure (a variable, or the beginning of an array, common, structure, etc.).  Two numbers, base_reg and displacement, are associated.  Their values are given by the data elements.  Base_reg is assigned one of nine possible symbolic values which describe the addressing scheme used to find the data structure.  It is meaningful to the linker.  The possible symbolic values are P+, P−, DB, DL, Q+, Q−, SB, S−, and DR.  Displacement specifies the byte offset where the data structure is located.  Note that this offset is measured relative to the beginning of the data space of the file for which the nm listing is made.  The actual byte offset of the data structure in the executable a.out file could change. 

IDATA or UDATA specifies that the entry refers to an indirectly-addressable, uninitialized array, or an indirectly-addressable, initialized common block.  One number, displacement, is associated.  Its value is given by the data element.  It is identical to the displacement described above under DDATA. 

DCOMM or ICOMM
specifies that the entry is treated as a common block. Three numbers, blocksize, needs_length_word, and displacement, are associated.  Their values are given by the data elements.  Blocksize is the size, in bytes, of the common block.  Needs_length_word is a boolean value which appears in a print-out as either 0 or 1.  If its value is 1, the linker places the value of (blocksize − 4) in the first four bytes of the common block.  This information is necessary when linking FORTRAN programs.  Displacement is identical to that described under DDATA above. 

PTR specifies that the entry is a pointer to an indirectly-addressable data structure (variable, array, common block, etc.).  Three numbers, ptr_to_common, target, and address, are associated.  Their values are given by the data elements.  Ptr_to_common is an eight-bit boolean expression.  Its value is given as 1 (true) or 0 (false).  If true, then the entry is a pointer to a common block.  If false, the entry is a pointer to some other type of data structure.  Target is an index into the symbol table to the entry that describes the target of the data structure pointer.  Address is a pointer to the data structure pointer; that is, an indirect pointer to the data structure. 

SEGMENT not currently generated; reserved for future use. 

FILENAME specifies that the entry is a file name.  One number, sequence, is associated.  Its value is given by the data element.  Sequence reflects the order in which the linker encountered each file name. 

SEE ALSO

ar(1), a.out(5), ar(5). 

DIAGNOSTICS

Nm generates an error message for the following conditions:

invalid option
cannot open file
bad magic number
read error

 
 

Hewlett-Packard  —  last mod. May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026