about summary refs log tree commit diff
path: root/elf/libc-early-init.h
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/libc-early-init.h
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/libc-early-init.h')
-rw-r--r--elf/libc-early-init.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/elf/libc-early-init.h b/elf/libc-early-init.h
index 5185fa8895..8f7836dcea 100644
--- a/elf/libc-early-init.h
+++ b/elf/libc-early-init.h
@@ -22,14 +22,17 @@
 struct link_map;
 
 /* If LIBC_MAP is not NULL, look up the __libc_early_init symbol in it
-   and call this function.  */
-void _dl_call_libc_early_init (struct link_map *libc_map) attribute_hidden;
+   and call this function, with INITIAL as the argument.  */
+void _dl_call_libc_early_init (struct link_map *libc_map, _Bool initial)
+  attribute_hidden;
 
 /* In the shared case, this function is defined in libc.so and invoked
    from ld.so (or on the fist static dlopen) after complete relocation
    of a new loaded libc.so, but before user-defined ELF constructors
    run.  In the static case, this function is called directly from the
-   startup code.  */
-void __libc_early_init (void);
+   startup code.  If INITIAL is true, the libc being initialized is
+   the libc for the main program.  INITIAL is false for libcs loaded
+   for audit modules, dlmopen, and static dlopen.  */
+void __libc_early_init (_Bool initial);
 
 #endif /* _LIBC_EARLY_INIT_H */