On 8/8/23 02:10, Alex Bennée wrote:
One thing I'm slightly confused by is the ELF_ET_DYN_BASE can be above
this (or sometimes the same). Should the mapping of ELF segments be
handled with mmap_next_start? I assume once mmap_next_start meets the
mappings for the ELF segments we skip over until we get to more free
space after the program code?
ELF_ET_DYN_BASE is a hack imported from the kernel to put separation between an ET_DYN
main binary and TASK_UNMAPPED_BASE, so that the brk can follow the binary and have space
to grow.
All of this is part of the "legacy" memory layout, for which there is a
personality flag.
For 8.2, I think we should work on implementing the "new" memory layout, which places
everything top-down. But most importantly it completely separates brk from the binary.
r~