0

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

vimuth
  • 5,064
  • 33
  • 79
  • 116
  • "How is that even possible?" -- why not? It's hard to answer your question, because you didn't explain _why_ you believe offset `0` is problematic. – Employed Russian Jul 30 '22 at 13:19

1 Answers1

1

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.

TallChuck
  • 1,725
  • 11
  • 28