From 3908fa933a4354309225af616d9242f595e11ccf Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 30 Jun 2021 00:21:18 -0300 Subject: 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. --- elf/dl-open.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'elf/dl-open.c') 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 -- cgit 1.4.1