How can a LOAD segment have an offset of 0?

185 views Asked by At

Look at this readelf of an ELF file, the first LOAD segment has offset 0.

How is that even possible? Isn't the ELF header at offset 0?

readelf -l

1

1

There are 1 answers

0
TallChuck On

Yes, the ELF header is at offset 0, which means that it will be loaded into the virtual memory of the process that runs the executable. Note that it's marked read-only, and not executable. The second LOAD segment has an E in the flags column, so that's probably the .text section.