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

Wilco Dijkstra Wilco.Dijkstra@arm.com
Fri Apr 10 12:37:57 GMT 2026


Hi HJ,

> If the first R segment size is smaller than 2MB, don't you need to
> load it from the offset 0 to align the second segment to 2MB?

Alignment only applies to the *start* of the binary. So if you want the second
segment to be aligned to 2MB, you must do that in the linker.

Remember all offsets have been determined during linking and are thus fixed.

>> How? If you want to ignore -zseparate-code/--(no-)rosegment, do it in the linker and
>> warn the user that you're merging sections that they explicitly requested to be separate.
>
> It goes back to the question of whether THP should be optional or
> on by default.

No idea what you mean - THP has been on by default for a decade in some distros.

Cheers,
Wilco


More information about the Libc-alpha mailing list