[RFC,01/19] Inhibit early libcalls before ifunc support is ready
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
Commit Message
From: Christoph Müllner <christoph.muellner@vrull.eu>
One of the few tasks in __libc_start_main_impl, before
ifunc support is ready on many architectures is to process
the AUX vector. GCC is able to detect libcall routines in
this code, which will result in invocations of uninitialized
ifunc pointers.
Let's set the proper attributes to these early functions
to avoid avoid libcalls.
This was observed to be an issue (endless loop) in combination with:
- GCC upstream/master
- glibc upstream/master
- glibc built with -O3
- target arch RISC-V (RV64)
- experimental RISC-V ifunc support patches
Other combinations/architectures might be affected as well.
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
---
csu/libc-start.c | 1 +
elf/dl-support.c | 1 +
2 files changed, 2 insertions(+)
@@ -231,6 +231,7 @@ STATIC int LIBC_START_MAIN (int (*main) (int, char **, char **
locate constructors and destructors. For statically linked
executables, the relevant symbols are access directly. */
STATIC int
+inhibit_loop_to_libcall
LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
int argc, char **argv,
#ifdef LIBC_START_MAIN_AUXVEC_ARG
@@ -242,6 +242,7 @@ __rtld_lock_define_initialized_recursive (, _dl_load_tls_lock)
int _dl_clktck;
void
+inhibit_loop_to_libcall
_dl_aux_init (ElfW(auxv_t) *av)
{
#ifdef NEED_DL_SYSINFO