about summary refs log tree commit diff
path: root/elf/dl-open.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-06-30 00:21:18 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2021-07-30 16:01:44 -0300
commit3908fa933a4354309225af616d9242f595e11ccf (patch)
treec5762614dfb75db96afc0e614c8bfa8f1cd23070 /elf/dl-open.c
parentc37fc3ebf0607ce1953c565ffe56d56555eeb25e (diff)
downloadglibc-3908fa933a4354309225af616d9242f595e11ccf.tar.gz
glibc-3908fa933a4354309225af616d9242f595e11ccf.tar.xz
glibc-3908fa933a4354309225af616d9242f595e11ccf.zip
elf: Fix audit regression
Commit 03e187a41d9 added a regression when an audit module does not have
libc as DT_NEEDED (although unusual it is possible).

Checked on x86_64-linux-gnu.
Diffstat (limited to 'elf/dl-open.c')
-rw-r--r--elf/dl-open.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/elf/dl-open.c b/elf/dl-open.c
index d2240d8747..ec386626f9 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -769,16 +769,9 @@ dl_open_worker (void *a)
      namespace.  */
   if (!args->libc_already_loaded)
     {
+      /* dlopen cannot be used to load an initial libc by design.  */
       struct link_map *libc_map = GL(dl_ns)[args->nsid].libc_map;
-#ifdef SHARED
-      bool initial = libc_map->l_ns == LM_ID_BASE;
-#else
-      /* In the static case, there is only one namespace, but it
-	 contains a secondary libc (the primary libc is statically
-	 linked).  */
-      bool initial = false;
-#endif
-      _dl_call_libc_early_init (libc_map, initial);
+      _dl_call_libc_early_init (libc_map, false);
     }
 
   /* Run the initializer functions of new objects.  Temporarily