The gnm Utility Program

The gnm Utility Program prints the symbol table of an ELF object file, object library file, or executable file created by the Green Hills development tools.

Usage

To use gnm, enter:

gnm [options] [files]

where

-help Display information about all options.

options gnm options for ELF are listed below.

files Name(s) of ELF file(s).

ELF File Options

Options when using gnm with ELF format files include:

-a Prints special symbols which are normally suppressed.

-h Does not print headers.

-l Prints an asterisk (*) after symbol type for WEAK symbols (-p mode only).

-n Sorts output by symbol name.

-o Prints value and size of symbols in octal.

-p Three column output format.

-r Prepends filename to each line of output.

-u Prints undefined symbols only.

-v Sorts output by symbol value.

-x Prints value and size of symbols in hexadecimal.

-V Prints gnm version.

Default Output Format

By default, a seven column listing is produced similar to the following:
Index Value Size Type Bind Other Shndx Name
37
0x00000100
0x00000098
FUNC
GLOBL
0
.text
_ _start
205
0x00000ed0
0x00000000
FUNC
GLOBL
0
.syscall
_ _dotsyscall

Index Position of symbol in the symbol table.

Value The value or address of the symbol.

Size Size of the symbol (e.g. a 4-byte integer would show a size of four)

Type One of the following:

NOTY Typeless symbol.

FILE Filename symbol.

SECT Section name symbol.

OBJT Data symbol.

FUNC Code symbol.

Bind One of the following:

LOCL Local symbol (e.g. C/C++ static).

GLOB Global symbol.

WEAK Weak global symbol (value resolves to zero if undefined).

Other Reserved field, generally zero.

Shndx The name of the section where symbol is defined, for example:

.text Code-defined in the .text section.

.data Data-defined in the .data section.

ABS No section (e.g. a filename symbol).

COMMON Common variable whose section is not yet determined.

Name Symbol name.

Alternate 3 Column Output Format with -p

The alternate output format has only three columns and is provided for backwards compatibility with tools which can read only this format. This easily parsable format is enabled with the -p option:

00000000 T _ _start
U _ _ _dotsyscall

The first column is the value or address of the symbol. The second column is the kind of symbol as shown in the following table. The third column is the name of the symbol.

A External absolute.

a Local absolute.

B External zeroed data.

b Local zeroed data.

C Common variable (same as B except not yet assigned to a section).

D External initialized data.

d Local initialized data.

G External initialized SDA.

g Local initialized SDA.

S External zeroed SDA.

s Local zeroed SDA.

T External text.

t Local text.

U External undefined.

In -p mode, it is not possible to accurately describe all sections and all storage classes. In particular, user-defined SDA symbols and all other symbols in special sections are shown with letters SDA = GgSs.


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.