[glibc] elf: Remove __glibc_likely from _dl_sort_maps
Adhemerval Zanella via Glibc-cvs <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6af4d48a91e5838cbd5c45f66ca140f9f4cf0ea1 commit 6af4d48a91e5838cbd5c45f66ca140f9f4cf0ea1 Author: litenglong <[email protected]> Date: Fri Aug 14 10:32:16 2026 +0800 elf: Remove __glibc_likely from _dl_sort_maps _dl_sort_maps is only called during shared object loading and unloading, not on any hot path. The branch predictor hint has no measurable benefit, and removing it simplifies the code and avoids future maintenance when the default algorithm changes. Suggested-by: Wilco Dijkstra <[email protected]> Reviewed-by: Wilco Dijkstra <[email protected]> Diff: --- elf/dl-sort-maps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/elf/dl-sort-maps.c b/elf/dl-sort-maps.c index 28ba850a6b..1469952b3a 100644 --- a/elf/dl-sort-maps.c +++ b/elf/dl-sort-maps.c @@ -303,7 +303,7 @@ _dl_sort_maps (struct link_map **maps, unsigned int nmaps, PTR_MANGLE/DEMANGLE, further impairing performance of small, common input cases. A simple if-case with direct function calls appears to be the fastest. */ - if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original)) + if (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original) _dl_sort_maps_original (maps, nmaps, force_first, for_fini); else _dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);