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

H.J. Lu hjl.tools@gmail.com
Wed Apr 8 20:27:56 GMT 2026


On Wed, Apr 8, 2026 at 10:15 PM Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
>
> Hi HJ,
>
> > > > > >
> > > > > >   LOAD           0x000000 0x00400000 0x00400000 0x16d110 0x16d110 R   0x1000
> > > > > >   LOAD           0x16e000 0x0056e000 0x0056e000 0x1055d9 0x1055d9 R E 0x1000
> > > > > >
> > > > > > into a single RE THP map.
>
> So my question is why do we need to do this in both loaders?
>
> Shouldn't the linker just do better here? Eg. it can merge program headers
> and related read-only data into the text segment even with -zseparate-code.

x86 linker on master branch no longer does that after the fix for

https://sourceware.org/bugzilla/show_bug.cgi?id=34003

-- 
H.J.


More information about the Libc-alpha mailing list