mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
Consolidate link map sorting
Combine the four places where link maps are sorted into a single function. This also moves the logic to skip the first map (representing the main binary) to the callers.
This commit is contained in:
@@ -241,8 +241,10 @@ _dl_close_worker (struct link_map *map, bool force)
|
||||
}
|
||||
}
|
||||
|
||||
/* Sort the entries. */
|
||||
_dl_sort_fini (maps, nloaded, used, nsid);
|
||||
/* Sort the entries. We can skip looking for the binary itself which is
|
||||
at the front of the search list for the main namespace. */
|
||||
_dl_sort_maps (maps + (nsid == LM_ID_BASE), nloaded - (nsid == LM_ID_BASE),
|
||||
used + (nsid == LM_ID_BASE), true);
|
||||
|
||||
/* Call all termination functions at once. */
|
||||
#ifdef SHARED
|
||||
|
Reference in New Issue
Block a user