A symbol table contains information to locate and relocate symbolic definitions and references. The Oracle Solaris SPARC assembler creates a symbol table section for the object file. It makes an entry in the symbol table for each symbol that is defined or referenced in the input file and is needed during linking. The symbol table is then used by the Oracle Solaris linker during relocation. The section header contains the symbol table index for the first non-local symbol.
A symbol table contains the following information defined by Elf32_Sym and Elf64_Sym in sys/elf.h and Symbol Table Section in Oracle Solaris 11.2 Linkers and Libraries Guide :
st_name
Description: Index into the object file symbol string table. A value of zero indicates the symbol table entry has no name; otherwise, the value represents the string table index that gives the symbol name.
st_value
Description: Value of the associated symbol. This value is dependent on the context; for example, it may be an address, or it may be an absolute value.
st_size
Description: Size of symbol. A value of 0 indicates that the symbol has either no size or an unknown size.
st_info
Description: Specifies the symbol type and binding attributes. Table 2–5 and Table 2–6 describe these values.
st_other
Description: Specifies a symbol's visibility.
st_shndx
Description: Contains the section header table index to another relevant section, if specified. As a section moves during relocation, references to the symbol will continue to point to the same location because the value of the symbol will change as well.
|
Table 2–6 shows the symbol binding attributes.
|