next up previous contents
Next: The Implementation of Sim386 Up: The Executable and Linking Previous: ELF Segments

   
ELF Data Representation

The ELF control data is represented in a machine-independent format so that it can be accessed and interpreted seamlessly across machines. Figure 2.10 lists the definitions for the storage classes of the ELF control data. The remaining data in the object file, the data other than the control data, can be encoded to agree with the byte order, in the way necessary for the target machine. All data structures that the object file format defines follow the size and alignment guidelines for the relevant storage class[8]. If necessary, data structures are padded to ensure alignment; for example, a data structure might contain explicit padding to ensure 4-byte alignment for 4-byte objects, to force structure sizes to be a multiple of 4[8]. Alignment information is also included in the structures for sections and segments so that these structures, when placed in memory, can be properly aligned. In order to maintain a high level of portability, data fields in structures are expressed in bytes rather than bits since bit manipulation can be machine dependent. The cost of this portability is some wasted space.


next up previous contents
Next: The Implementation of Sim386 Up: The Executable and Linking Previous: ELF Segments
Michael L. Haungs
1998-09-21