+2014-10-01 Kostya Serebryany <konstantin.s.serebryany@gmail.com>
+
+ * elf/dl-deps.c
+ (preload): New functions broken out of _dl_map_object_deps.
+ (_dl_map_object_deps): Remove a nested function. Update call sites.
+
2014-10-01 Joseph Myers <joseph@codesourcery.com>
[BZ #14138]
\
__result; })
+static void
+preload (struct list *known, unsigned int *nlist, struct link_map *map)
+{
+ known[*nlist].done = 0;
+ known[*nlist].map = map;
+ known[*nlist].next = &known[*nlist + 1];
+
+ ++*nlist;
+ /* We use `l_reserved' as a mark bit to detect objects we have
+ already put in the search list and avoid adding duplicate
+ elements later in the list. */
+ map->l_reserved = 1;
+}
void
internal_function
const char *errstring;
const char *objname;
- void preload (struct link_map *map)
- {
- known[nlist].done = 0;
- known[nlist].map = map;
- known[nlist].next = &known[nlist + 1];
-
- ++nlist;
- /* We use `l_reserved' as a mark bit to detect objects we have
- already put in the search list and avoid adding duplicate
- elements later in the list. */
- map->l_reserved = 1;
- }
-
/* No loaded object so far. */
nlist = 0;
/* First load MAP itself. */
- preload (map);
+ preload (known, &nlist, map);
/* Add the preloaded items after MAP but before any of its dependencies. */
for (i = 0; i < npreloads; ++i)
- preload (preloads[i]);
+ preload (known, &nlist, preloads[i]);
/* Terminate the lists. */
known[nlist - 1].next = NULL;