mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-24 22:10:13 +00:00
elf: Rename _dl_sort_maps parameter from skip to force_first
The new implementation will not be able to skip an arbitrary number of objects. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
183d997372
commit
dbb75513f5
@ -27,12 +27,12 @@
|
|||||||
If FOR_FINI is true, this is called for finishing an object. */
|
If FOR_FINI is true, this is called for finishing an object. */
|
||||||
static void
|
static void
|
||||||
_dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
|
_dl_sort_maps_original (struct link_map **maps, unsigned int nmaps,
|
||||||
unsigned int skip, bool for_fini)
|
bool force_first, bool for_fini)
|
||||||
{
|
{
|
||||||
/* Allows caller to do the common optimization of skipping the first map,
|
/* Allows caller to do the common optimization of skipping the first map,
|
||||||
usually the main binary. */
|
usually the main binary. */
|
||||||
maps += skip;
|
maps += force_first;
|
||||||
nmaps -= skip;
|
nmaps -= force_first;
|
||||||
|
|
||||||
/* A list of one element need not be sorted. */
|
/* A list of one element need not be sorted. */
|
||||||
if (nmaps <= 1)
|
if (nmaps <= 1)
|
||||||
@ -182,7 +182,7 @@ dfs_traversal (struct link_map ***rpo, struct link_map *map,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
_dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
|
_dl_sort_maps_dfs (struct link_map **maps, unsigned int nmaps,
|
||||||
unsigned int skip __attribute__ ((unused)), bool for_fini)
|
bool force_first __attribute__ ((unused)), bool for_fini)
|
||||||
{
|
{
|
||||||
for (int i = nmaps - 1; i >= 0; i--)
|
for (int i = nmaps - 1; i >= 0; i--)
|
||||||
maps[i]->l_visited = 0;
|
maps[i]->l_visited = 0;
|
||||||
@ -286,7 +286,7 @@ _dl_sort_maps_init (void)
|
|||||||
|
|
||||||
void
|
void
|
||||||
_dl_sort_maps (struct link_map **maps, unsigned int nmaps,
|
_dl_sort_maps (struct link_map **maps, unsigned int nmaps,
|
||||||
unsigned int skip, bool for_fini)
|
bool force_first, bool for_fini)
|
||||||
{
|
{
|
||||||
/* It can be tempting to use a static function pointer to store and call
|
/* It can be tempting to use a static function pointer to store and call
|
||||||
the current selected sorting algorithm routine, but experimentation
|
the current selected sorting algorithm routine, but experimentation
|
||||||
@ -296,9 +296,9 @@ _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
|
|||||||
input cases. A simple if-case with direct function calls appears to
|
input cases. A simple if-case with direct function calls appears to
|
||||||
be the fastest. */
|
be the fastest. */
|
||||||
if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
|
if (__glibc_likely (GLRO(dl_dso_sort_algo) == dso_sort_algorithm_original))
|
||||||
_dl_sort_maps_original (maps, nmaps, skip, for_fini);
|
_dl_sort_maps_original (maps, nmaps, force_first, for_fini);
|
||||||
else
|
else
|
||||||
_dl_sort_maps_dfs (maps, nmaps, skip, for_fini);
|
_dl_sort_maps_dfs (maps, nmaps, force_first, for_fini);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_TUNABLES. */
|
#endif /* HAVE_TUNABLES. */
|
||||||
|
@ -1048,9 +1048,11 @@ extern void _dl_init (struct link_map *main_map, int argc, char **argv,
|
|||||||
initializer functions have completed. */
|
initializer functions have completed. */
|
||||||
extern void _dl_fini (void) attribute_hidden;
|
extern void _dl_fini (void) attribute_hidden;
|
||||||
|
|
||||||
/* Sort array MAPS according to dependencies of the contained objects. */
|
/* Sort array MAPS according to dependencies of the contained objects.
|
||||||
|
If FORCE_FIRST, MAPS[0] keeps its place even if the dependencies
|
||||||
|
say otherwise. */
|
||||||
extern void _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
|
extern void _dl_sort_maps (struct link_map **maps, unsigned int nmaps,
|
||||||
unsigned int skip, bool for_fini) attribute_hidden;
|
bool force_first, bool for_fini) attribute_hidden;
|
||||||
|
|
||||||
/* The dynamic linker calls this function before and having changing
|
/* The dynamic linker calls this function before and having changing
|
||||||
any shared object mappings. The `r_state' member of `struct r_debug'
|
any shared object mappings. The `r_state' member of `struct r_debug'
|
||||||
|
Loading…
Reference in New Issue
Block a user