1
0
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:
Andreas Schwab
2017-11-07 15:24:19 +01:00
parent de61465c04
commit c2c299fd24
8 changed files with 153 additions and 215 deletions

View File

@@ -960,8 +960,8 @@ extern void _dl_init (struct link_map *main_map, int argc, char **argv,
extern void _dl_fini (void) attribute_hidden;
/* Sort array MAPS according to dependencies of the contained objects. */
extern void _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used,
Lmid_t ns) attribute_hidden;
extern void _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
char *used, bool for_fini) attribute_hidden;
/* The dynamic linker calls this function before and having changing
any shared object mappings. The `r_state' member of `struct r_debug'