about summary refs log tree commit diff
path: root/elf/rtld.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-04-29 15:44:03 +0200
committerFlorian Weimer <fweimer@redhat.com>2020-04-29 15:44:03 +0200
commit03e187a41d91069543cfcf33469a05912e555447 (patch)
treea2f3afcc3e41af612e40fc9cab1ba9b3a811ce38 /elf/rtld.c
parent2ad5d0845d80589d0adf86593bd36a7c71a521f8 (diff)
downloadglibc-03e187a41d91069543cfcf33469a05912e555447.tar.gz
glibc-03e187a41d91069543cfcf33469a05912e555447.tar.xz
glibc-03e187a41d91069543cfcf33469a05912e555447.zip
elf: Add initial flag argument to __libc_early_init
The rseq initialization should happen only for the libc in the base
namespace (in the dynamic case) or the statically linked libc.  The
__libc_multiple_libcs flag does not quite cover this case at present,
so this commit introduces a flag argument to __libc_early_init,
indicating whether the libc being libc is the primary one (of the main
program).

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'elf/rtld.c')
-rw-r--r--elf/rtld.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/elf/rtld.c b/elf/rtld.c
index 0016db86a7..5ccc3c2dbb 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2373,8 +2373,10 @@ ERROR: '%s': cannot process note segment.\n", _dl_argv[0]);
       rtld_timer_accum (&relocate_time, start);
     }
 
-  /* Relocation is complete.  Perform early libc initialization.  */
-  _dl_call_libc_early_init (GL(dl_ns)[LM_ID_BASE].libc_map);
+  /* Relocation is complete.  Perform early libc initialization.  This
+     is the initial libc, even if audit modules have been loaded with
+     other libcs.  */
+  _dl_call_libc_early_init (GL(dl_ns)[LM_ID_BASE].libc_map, true);
 
   /* Do any necessary cleanups for the startup OS interface code.
      We do these now so that no calls are made after rtld re-relocation