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.
-help Display information about all options.
options gnm options for ELF are listed below.
Options when using gnm with ELF format files include:
-a Prints special symbols which are normally suppressed.
-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.
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)
LOCL Local symbol (e.g. C/C++ static).
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.
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.
C Common variable (same as B except not yet assigned to a section).
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.