JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
SPARC Assembly Language Reference Manual     Oracle Solaris 11 Express 11/10
search filter icon
search icon

Document Information

Preface

1.  SPARC Assembler for SunOS 5.x

2.  Assembler Syntax

3.  Executable and Linking Format

3.1 ELF Header

3.2 Sections

3.2.1 Section Header

3.2.2 Predefined User Sections

3.2.2.1 Creating an .init Section in an Object File

3.2.2.2 Creating a .fini Section in an Object File

3.2.3 Predefined Non-User Sections

3.3 Locations

3.4 Addresses

3.5 Relocation Tables

3.6 Symbol Tables

3.7 String Tables

3.8 Assembler Directives

3.8.1 Section Control Directives

3.8.2 Symbol Attribute Directives

3.8.3 Assignment Directive

3.8.4 Data Generating Directives

4.  Converting Files to the New Format

5.  Instruction-Set Mapping

A.  Pseudo-Operations

B.  Examples of Pseudo-Operations

C.  Using the Assembler Command Line

D.  An Example Language Program

E.  SPARC-V9 Instruction Set

Index

3.6 Symbol Tables

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

A symbol table contains the following information:

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.

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.

size

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

info

Description: Specifies the symbol type and binding attributes. Table 3-6 and Table 3-7 describe these values.

other

Description: Undefined meaning. Current value is 0.

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 3-6 Symbol Type Attributes

Value
Type
Description
0
notype
Type not specified.
1
object
Symbol is associated with a data object; for example, a variable or an array.
2
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.
3
section
Symbol is associated with a section. These types of symbols are primarily used for relocation.
4
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 shows the symbol binding attributes.

Table 3-7 Symbol Binding Attributes

Value
Binding
Description
0
local
Symbol is defined in the object file and not accessible in other files. Local symbols of the same name may exist in multiple files.
1
global
Symbol is either defined externally or defined in the object file and accessible in other files.
2
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.