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

Wilco Dijkstra Wilco.Dijkstra@arm.com
Thu Apr 9 23:18:45 GMT 2026


Hi HJ,

>> > 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.
>>
>> But it doesn't, that's my issue. It would be perfectly fine to generalize Rui's patch
>
> What did you mean by "doesn't"?

It merges load segments which is not the same as aligning.

>> to remove the condition that the R+X segment must start at zero offset and check
>
> The easiest way to implement it is to combine R + RX segments in one segment
> from the file offset 0.  We only need 1 load, instead of 2.

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.

Cheers,
Wilco


More information about the Libc-alpha mailing list