ELF LOAD segments creating holes in the process image on GNU/Linux

Florian Weimer fweimer@redhat.com
Mon Jan 3 13:23:38 GMT 2022


* H. J. Lu:

>> Ideally?  p_offset, p_vaddr, p_filesz, p_memsz should all be multiples
>> of the page size, to closer reflect what can actually be loaded.
>>
>> Then, for each LOAD segment, p_vaddr plus p_memsz should be equal to
>> p_vaddr of the next LOAD segment.
>
> Filled with zeros?

No, with file contents.  We can't zero-fill at a sub-page granularity.
There shouldn't be page-sized holes, definitely not for 4K-only targets.

Thanks,
Florian



More information about the Binutils mailing list