x86 Assembly Language Reference Manual

Symbol Tables

The symbol table contains information to locate and relocate symbolic definitions and references. The assembler creates the 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 link editor during relocation. The symbol table's section header contains the symbol table index for the first non-local symbol.

The symbol table contains the following information:

st_name

Index into the object file symbol string table. A value of zero indicates the corresponding entry in the symbol table has no name; otherwise, the value represents the string table index that gives the symbol name.

st_value

Value of the associated symbol. This value is dependent on the context; for example, it can be an address, or it can be an absolute value.

st_size

Size of symbol. A value of 0 indicates that the symbol has either no size or an unknown size.

st_info

Specifies the symbol type and binding attributes. Table 3-6 and Table 3-7 describe the symbol types and binding attributes.

st_other

Undefined meaning. Current value is 0.

st_shndx

Contains the section header table index to another relevant section, if specified. As a section moves during relocation, references to the symbol continue to point to the same location because the value of the symbol changes as well.

Table 3-6 Symbol Types

Value 

Type 

Description 

notype 

Type not specified. 

object 

Symbol is associated with a data object; for example, a variable or an array.

func 

Symbol is associated with a function or other executable code. When another object file references a function from a shared object, the link editor automatically creates a procedure linkage table entry for the referenced symbol.

section 

Symbol is associated with a section. These types of symbols are primarily used for relocation.

file 

Gives the name of the source file associated with the object file. 

13 

15 

loproc 

hiproc 

Values reserved for processor-specific semantics. 

Table 3-7 Binding Attributes

Value 

Binding 

Description 

local 

Symbol is defined in the object file and not accessible in other files. Local symbols of the same name can exist in multiple files.

global 

Symbol is either defined externally or defined in the object file and accessible in other files.

weak 

Symbol is either defined externally or defined in the object file and accessible in other files; however, these definitions have a lower precedence than globally defined symbols.

13 

15 

loproc 

hiproc 

Values reserved for processor-specific semantics.