Reputation: 69
I'm writing the structure of an Elf file, a sort of summary or topology. For a little report, I have, and I'm posting here because I am a bit confused. Have I understood it correctly?
To explain a bit what Im thinking An ELF file consist of two parts 1: ELF header 2: File data
The file data consist of 3 parts, The program header, the section header and Data, now what confuses me is, is the arrows supposed to be like this? A file data consist of 3 parts, but after my understanding this is the process. source: https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#/media/File:Elf-layout--en.svg
] the figure Im trying to make, to make it easier to understand of the WHOLE ELF file rather than the only as it shown on wikipedia.
Upvotes: 0
Views: 236
Reputation: 213526
An ELF file consist of two parts 1: ELF header 2: File data
In my opinion it's wrong to think about ELF
as having only two parts. An ELF file is structured, with many optional parts.
You can think of it as a folder with table of contents (ELF
header) describing other subsections (section headers, program headers) which in turn describe file data. Many parts of this folder can be removed without invalidating the entire file, and some parts can't be present for some types of files, while others must be present.
For example, an ET_EXEC
file must contain program headers, and may contain section headers (section headers can be removed with the strip
command).
In your picture, I would call "File Data" what you called "Data". The other parts: program headers, section headers are all "ELF metadata", not very different from the ELF header.
Upvotes: 0