]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
remove nested functions from elf/dl-deps.c
authorKostya Serebryany <konstantin.s.serebryany@gmail.com>
Wed, 1 Oct 2014 21:34:45 +0000 (14:34 -0700)
committerKostya Serebryany <konstantin.s.serebryany@gmail.com>
Wed, 1 Oct 2014 21:34:45 +0000 (14:34 -0700)
ChangeLog
elf/dl-deps.c

index 2d9066eeb0be623fe55bbf1fcb84a362c8c31f33..dedc578b7f3c52880ea5c9662be82ac537b34c07 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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]
index c3b0cfc908015acae8a2b524dbc27fd2e676223c..f66b2669acce73df0f3c5b630f6866b8498443e9 100644 (file)
@@ -138,6 +138,19 @@ cannot load auxiliary `%s' because of empty dynamic string token "       \
                                                                              \
     __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
@@ -155,28 +168,15 @@ _dl_map_object_deps (struct link_map *map,
   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;