Linker and Libraries Guide

Register Symbols

The SPARC architecture supports register symbols, which are symbols that initialize a global register. A symbol table entry for a register symbol contains the entries listed in the following table.

Table 7–26 SPARC: ELF Symbol Table Entry: Register Symbol

Field 

Meaning  

st_name

Index into string table of the name of the symbol, or 0 for a scratch register. 

st_value

Register number. See the ABI manual for integer register assignments.

st_size

Unused (0). 

st_info

Bind is typically STB_GLOBAL, type must be STT_SPARC_REGISTER.

st_other

Unused (0). 

st_shndx

SHN_ABS if this object initializes this register symbol; SHN_UNDEF otherwise.

The register values defined for SPARC are listed in the following table.

Table 7–27 SPARC: ELF Register Numbers

Name 

Value 

Meaning  

STO_SPARC_REGISTER_G2

0x2

%g2

STO_SPARC_REGISTER_G3

0x3

%g3

Absence of an entry for a particular global register means that the particular global register is not used at all by the object.