/* Run time dynamic linker.
- Copyright (C) 1995-2022 Free Software Foundation, Inc.
+ Copyright (C) 1995-2023 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
#include <dl-execve.h>
#include <dl-find_object.h>
#include <dl-audit-check.h>
+#include <dl-call_tls_init_tp.h>
#include <assert.h>
._dl_sysinfo = DL_SYSINFO_DEFAULT,
#endif
._dl_debug_fd = STDERR_FILENO,
-#if !HAVE_TUNABLES
- ._dl_hwcap_mask = HWCAP_IMPORTANT,
-#endif
._dl_lazy = 1,
._dl_fpu_control = _FPU_DEFAULT,
._dl_pagesize = EXEC_PAGESIZE,
ElfW(Addr) start_addr;
/* Do not use an initializer for these members because it would
- intefere with __rtld_static_init. */
+ interfere with __rtld_static_init. */
GLRO (dl_find_object) = &_dl_find_object;
/* If it hasn't happen yet record the startup time. */
GL(dl_initial_dtv) = GET_DTV (tcbp);
/* And finally install it for the main thread. */
- const char *lossage = TLS_INIT_TP (tcbp);
- if (__glibc_unlikely (lossage != NULL))
- _dl_fatal_printf ("cannot set up thread-local storage: %s\n", lossage);
- __tls_init_tp ();
+ call_tls_init_tp (tcbp);
__rtld_tls_init_tp_called = true;
return tcbp;
newp->fptr[cnt] = NULL;
++cnt;
- cp = rawmemchr (cp, '\0') + 1;
+ cp = strchr (cp, '\0') + 1;
}
while (*cp != '\0');
assert (cnt == naudit_ifaces);
}
}
-/* Check if the executable is not actualy dynamically linked, and
+/* Check if the executable is not actually dynamically linked, and
invoke it directly in that case. */
static void
rtld_chain_load (struct link_map *main_map, char *argv0)
/* _dl_rtld_libname.next = NULL; Already zero. */
GL(dl_rtld_map).l_libname = &_dl_rtld_libname;
- /* Ordinarilly, we would get additional names for the loader from
+ /* Ordinarily, we would get additional names for the loader from
our DT_SONAME. This can't happen if we were actually linked as
a static executable (detect this case when we have no DYNAMIC).
If so, assume the filename component of the interpreter path to
_dl_argc -= 2;
_dl_argv += 2;
}
-#if HAVE_TUNABLES
else if (! strcmp (_dl_argv[1], "--list-tunables"))
{
state.mode = rtld_mode_list_tunables;
--_dl_argc;
++_dl_argv;
}
-#endif
else if (! strcmp (_dl_argv[1], "--list-diagnostics"))
{
state.mode = rtld_mode_list_diagnostics;
else
break;
-#if HAVE_TUNABLES
if (__glibc_unlikely (state.mode == rtld_mode_list_tunables))
{
__tunables_print ();
_exit (0);
}
-#endif
if (state.mode == rtld_mode_list_diagnostics)
_dl_print_diagnostics (_environ);
/* And finally install it for the main thread. */
if (! __rtld_tls_init_tp_called)
- {
- const char *lossage = TLS_INIT_TP (tcbp);
- if (__glibc_unlikely (lossage != NULL))
- _dl_fatal_printf ("cannot set up thread-local storage: %s\n",
- lossage);
- __tls_init_tp ();
- }
+ call_tls_init_tp (tcbp);
/* Make sure no new search directories have been added. */
assert (GLRO(dl_init_all_dirs) == GL(dl_all_dirs));
_dl_relocate_object might need to call `mprotect' for DT_TEXTREL. */
_dl_sysdep_start_cleanup ();
-#ifdef SHARED
/* Auditing checkpoint: we have added all objects. */
_dl_audit_activity_nsid (LM_ID_BASE, LA_ACT_CONSISTENT);
-#endif
/* Notify the debugger all new objects are now ready to go. We must re-get
the address since by now the variable might be in another object. */
_dl_show_auxv ();
break;
-#if !HAVE_TUNABLES
- case 10:
- /* Mask for the important hardware capabilities. */
- if (!__libc_enable_secure
- && memcmp (envline, "HWCAP_MASK", 10) == 0)
- GLRO(dl_hwcap_mask) = _dl_strtoul (&envline[11], NULL);
- break;
-#endif
-
case 11:
/* Path where the binary is found. */
if (!__libc_enable_secure
do
{
unsetenv (nextp);
- /* We could use rawmemchr but this need not be fast. */
- nextp = (char *) (strchr) (nextp, '\0') + 1;
+ nextp = strchr (nextp, '\0') + 1;
}
while (*nextp != '\0');
if (__access ("/etc/suid-debug", F_OK) != 0)
- {
-#if !HAVE_TUNABLES
- unsetenv ("MALLOC_CHECK_");
-#endif
- GLRO(dl_debug_mask) = 0;
- }
+ GLRO(dl_debug_mask) = 0;
if (state->mode != rtld_mode_normal)
_exit (5);