[PATCH] elf: Make _dl_sort_maps prefer default DFS algorithm

Wilco Dijkstra Wilco.Dijkstra@arm.com
Thu Aug 13 14:18:58 GMT 2026


Hi,

>On 13/08/26 09:16, litenglong wrote:
>> The default dynamic_sort tunable is 2, which maps to
>> dso_sort_algorithm_dfs.  Update the likely branch to match the
>> default, without changing behavior for valid tunable values.
>
> What does this change really gain here? I am inclined to avoid this kind of
> code churn.

Is this code executed frequently or is the sorting only done once? It the latter,
it cannot help. And if the sorting itself is expensive, it would be more useful to
optimize that instead.

So removing the __glibc_likely is best overall.

Cheers,
Wilco


More information about the Libc-alpha mailing list