diff mbox series

[RFC,v7,08/20] elf/dl-open.c: when creating a proxy check the libc_map in NS 0

Message ID 20201216132650.22949-9-vivek@collabora.com
State New
Headers show
Series Implementation of RTLD_SHARED for dlmopen | expand

Commit Message

Vivek Das Mohapatra Dec. 16, 2020, 1:26 p.m. UTC
The libc_already_loaded check normally considers the libc_map entry
in GL(dl_ns)[args->nsid].libc_map.

This is not correct for proxies, which use the libc_map from
the default namespace (as proxies are dummy entries that point
to the base namespace via their l_real members).
---
 elf/dl-open.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/elf/dl-open.c b/elf/dl-open.c
index a995e9086f..02e094a867 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -568,6 +568,7 @@  dl_open_worker (void *a)
     {
       proxy_ns = args->nsid;
       args->nsid = LM_ID_BASE;
+      args->libc_already_loaded = GL(dl_ns)[LM_ID_BASE].libc_map != NULL;
     }
 
   /* It was already open.  */