[PATCH v10 3/5] Fix assert during static startup (BZ 33326)
Florian Weimer
fweimer@redhat.com
Thu Jul 9 13:00:06 GMT 2026
* Adhemerval Zanella:
> diff --git a/elf/tst-assert-startup-static.c b/elf/tst-assert-startup-static.c
> new file mode 100644
> index 00000000000..66bc5d4913b
> --- /dev/null
> +++ b/elf/tst-assert-startup-static.c
> +/* The __tunables_init is called just before self-relocation and TLS setup,
> + and the __libc_assert_fail is used internally for assert() calls. */
> +extern _Noreturn __typeof (__assert_fail) __libc_assert_fail;
> +
> +void __tunables_init (char **env)
> +{
> +/* The assert called by the loader/startup issues __libc_assert_fail instead
> + of __libc_assert, and __libc_assert_fail does issues the translation
> + routines (which would require additional handling to be called at this
> + point, like disable stack protection). So issue the internal routine
> + directly, instead of using assert here. */
> + __libc_assert_fail ("error", __FILE__, __LINE__, __func__);
> +}
There's some grammar issue here: “does issues the translation”
> diff --git a/sysdeps/generic/dl-mmap.h b/sysdeps/generic/dl-mmap.h
> new file mode 100644
> index 00000000000..f786be0930c
> --- /dev/null
> +++ b/sysdeps/generic/dl-mmap.h
> +/* This mmap call is used to allocate some memory to backup assert() messages
> + before TLS setup is done (which setup the thread pointer used by some ABIs
> + to issues syscalls). */
typos: to back[ ]up
which set[s ]up
to [make] syscalls
(happens in other files, too)
sysdeps/unix/sysv/linux/i386/*.h uses t he phrase “to avoid use the
vDSO”. It should be “to avoid using the vDSO” or “to avoid use of the
vDSO”.
> diff --git a/sysdeps/s390/string-bitops.h b/sysdeps/s390/string-bitops.h
> new file mode 100644
> index 00000000000..5527bcbe454
> --- /dev/null
> +++ b/sysdeps/s390/string-bitops.h
> @@ -0,0 +1,27 @@
> +/* Zero byte detection, define whether to use stdbit.h s390 version.
Maybe: /* Zero byte detection control. s390x version.
Thanks,
Florian
More information about the Libc-alpha
mailing list