[PATCH v8 3/6] elf: Introduce _dl_map_segment_align hook for segment alignment tuning

H.J. Lu hjl.tools@gmail.com
Thu Apr 9 20:43:12 GMT 2026


On Thu, Apr 9, 2026 at 9:18 PM Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
>
> Hi HJ,
>
> > I was told that THP needed to start from the file offset 0.  So
> >
> >  LOAD           0x16e000 0x0056e000 0x0056e000 0x1055d9 0x1055d9 R E 0x1000
> >
> > doesn't work for THP.
>
> For it to work you'd need to align the file start. Rui's current patch doesn't
> do the alignment for this case, but we could generalize it and do it if either

Unless the first R segment is bigger than 2MB,  we need to align from the
file offset 0 anyway.   That is what my proposal does.

> R or R+W load segments are large enough.
>
> But that is different from changing the segments in the loader.
>
> Cheers,
> Wilco



-- 
H.J.


More information about the Libc-alpha mailing list