Symbols

An object file contains a symbol table that stores information about symbols in the object file. The linker uses this table when it performs relocation. See Section 2.7.

An object file symbol is a named 32-bit integer value, usually representing an address. A symbol can represent such things as the starting address of a function, variable, section, or an absolute integer (such as the size of the stack).

Symbols are defined in assembly by adding a label or a directive such as .set .equ .bss, or .usect.

Symbols have a binding, which is similar to the C concept of linkage. Both COFF and ELF file formats may contain symbols bound locally and globally. ELF also binds symbols as weak symbols.

Absolute symbols are symbols that have a numeric value. They may be constants. To the linker, such symbols are unsigned values, but the integer may be treated as signed or unsigned depending on how it is used. The range of legal values for an absolute integer is 0 to 2^32-1 for unsigned treatment and -2^31 to 2^31-1 for signed treatment.

In general, common symbols (see .common directive) are preferred over weak symbols.

See Section 4.8 for information about assembler symbols.