This preview shows page 1. Sign up to view the full content.
Unformatted text preview: rpret the object ﬁle. This includes the size of the ELF header, the object ﬁle type (e.g., relocatable, executable, or shared), the machine type (e.g., IA32) the ﬁle offset of the section header table, and the size and number of entries in the section header table. The locations and sizes of the various sections are described by the section header table, which contains a ﬁxed sized entry for each section in the object ﬁle.
ELF header .text .rodata .data .bss .symtab sections .rel.text .rel.data .debug .line describes object file sections .strtab Section header table 0 Figure 7.3: Typical ELF relocatable object ﬁle. Sandwiched between the ELF header and the section header table are the sections themselves. A typical ELF relocatable object ﬁle contains the following sections: .text: The machine code of the compiled program. .rodata: Read-only data such as the format strings in printf statements, and jump tables for switch statements (see Problem 7.14). .data: Initialized global C variables. Local C variables are maintained at run time on the stack, and do not...
View Full Document
- Spring '10
- The American