The symbols in a symbol table are written in the following order.
Index 0 in any symbol table is used to represent undefined symbols. This first entry in a symbol table is always completely zeroed. The symbol type is therefore STT_NOTYPE.
If the symbol table contains any local symbols, the second entry of the symbol table is an STT_FILE symbol giving the name of the file.
Section symbols of type STT_SECTION.
Register symbols of type STT_REGISTER.
Global symbols that have been reduced to local scope.
For each input file that supplies local symbols, a STT_FILE symbol giving the name of the input file, followed by the symbols in question.
The global symbols immediately follow the local symbols in the symbol table. The first global symbol is identified by the symbol table sh_info value. Local and global symbols are always kept separate in this manner, and cannot be mixed together.
Two symbol tables are of special interest in the Solaris OS.
This symbol table contains every symbol that describes the associated ELF file. This symbol table is typically non-allocable, and is therefore not available in the memory image of the process.
Global symbols can be eliminated from the .symtab by using a mapfile together with the ELIMINATE keyword. See Defining Additional Symbols with a mapfile. Local symbols can also be eliminated by using the link-editor -z redlocsym option.
This table contains a subset of the symbols from the .symtab table that are needed to support dynamic linking. This symbol table is allocable, and is therefore available in the memory image of the process.
The .dynsym table begins with the standard NULL symbol, followed by the files global symbols. STT_FILE symbols are typically not present in this symbol table. STT_SECTION symbols might be present if required by relocation entries.