32-bit ELF Data Types

The ELF object file format supports 32-bit architectures with 8-bit bytes. It must be modified for 64-bit architectures. Object files represent some control data with a machine-independent format, making it possible to identify object files and interpret their contents. Part of an object file uses the encoding of the target processor, regardless of the machine on which the file was created:

Table 1 Object File Types

Type 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 large integer
Elf32_Word
4
4
Unsigned large integer
unsigned char
1
1
Unsigned small integer

All data structures that the object file format defines follow the usual size and alignment guidelines for the relevant class. If necessary, data structures contain explicit padding to ensure 4-byte alignment for 4-byte objects, to force structure sizes to a multiple of 4. Data also have suitable alignment from the beginning of the file. For example, a structure containing Elf32_Addr will be aligned on a 4-byte boundary within the file.

For portability, ELF data structures use no bit fields.


Previous

Next



Copyright © 1999, Green Hills Software. All rights reserved.