ELF segments

As previously stated, ELF segments group the sections into loadable components, and describe how and where to load the ELF file in memory. The ideal ELF loader would only have to read ELF segments to load an ELF file, and (in the case of a relocatable ELF file) also have to load the dynamic sections and relocation sections.

To see an ELF's segments, use the following code:

As shown previously, the simple example has several program segments. The first segment describes the program header (which defines the segments) and, for the most part, can be ignored.

The second segment tells the ELF loader which relocator it is expecting ...

Get Hands-On System Programming with C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.