JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Solaris 11.1 Linkers and Libraries Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

Part I Using the Link-Editor and Runtime Linker

1.  Introduction to the Oracle Solaris Link Editors

2.  Link-Editor

3.  Runtime Linker

4.  Shared Objects

Part II Quick Reference

5.  Link-Editor Quick Reference

Part III Advanced Topics

6.  Direct Bindings

7.  Building Objects to Optimize System Performance

8.  Mapfiles

9.  Interfaces and Versioning

10.  Establishing Dependencies with Dynamic String Tokens

11.  Extensibility Mechanisms

Part IV ELF Application Binary Interface

12.  Object File Format

File Format

Data Representation

ELF Header

ELF Identification

Data Encoding

Sections

Section Merging

Special Sections

Ancillary Section

COMDAT Section

Group Section

Capabilities Section

Hash Table Section

Move Section

Note Section

Relocation Sections

Relocation Calculations

SPARC: Relocations

SPARC: Relocation Types

64-bit SPARC: Relocation Types

x86: Relocations

32-bit x86: Relocation Types

x64: Relocation Types

String Table Section

Symbol Table Section

Symbol Values

Symbol Table Layout and Conventions

Symbol Sort Sections

Register Symbols

Syminfo Table Section

Versioning Sections

Version Definition Section

Version Dependency Section

Version Symbol Section

13.  Program Loading and Dynamic Linking

14.  Thread-Local Storage

Part V Appendices

A.  Linker and Libraries Updates and New Features

B.  System V Release 4 (Version 1) Mapfiles

Index

Data Representation

The object file format supports various processors with 8-bit bytes, 32–bit architectures and 64–bit architectures. Nevertheless, the data representation is intended to be extensible to larger, or smaller, architectures. Table 12-1 and Table 12-2 list the 32–bit data types and 64–bit data types.

Object files represent some control data with a machine-independent format. This format provides for the common identification and interpretation of object files. The remaining data in an object file use the encoding of the target processor, regardless of the machine on which the file was created.

Table 12-1 ELF 32–Bit Data Types

Name
Size
Alignment
Purpose
Elf32_Addr
4
4
Unsigned program address
Elf32_Half
2
2
Unsigned medium integer
Elf32_Off
4
4
Unsigned file offset
Elf32_Sword
4
4
Signed integer
Elf32_Word
4
4
Unsigned integer
unsigned char
1
1
Unsigned small integer

Table 12-2 ELF 64–Bit Data Types

Name
Size
Alignment
Purpose
Elf64_Addr
8
8
Unsigned program address
Elf64_Half
2
2
Unsigned medium integer
Elf64_Off
8
8
Unsigned file offset
Elf64_Sword
4
4
Signed integer
Elf64_Word
4
4
Unsigned integer
Elf64_Xword
8
8
Unsigned long integer
Elf64_Sxword
8
8
Signed long integer
unsigned char
1
1
Unsigned small integer

All data structures that the object file format defines follow the natural size and alignment guidelines for the relevant class. Data structures can contain explicit padding to ensure 4-byte alignment for 4-byte objects, to force structure sizes to a multiple of 4, and so forth. Data also have suitable alignment from the beginning of the file. Thus, for example, a structure containing an Elf32_Addr member is aligned on a 4-byte boundary within the file. Similarly, a structure containing an Elf64_Addr member is aligned on an 8–byte boundary.


Note - For portability, ELF uses no bit-fields.