From 9001cb1102cddba54f0e84e147dfbb0356067356 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Wed, 3 Aug 2022 11:41:53 +0200 Subject: assert: Do not use stderr in libc-internal assert Redirect internal assertion failures to __libc_assert_fail, based on based on __libc_message, which writes directly to STDERR_FILENO and calls abort. Also disable message translation and reword the error message slightly (adjusting stdlib/tst-bz20544 accordingly). As a result of these changes, malloc no longer needs its own redefinition of __assert_fail. __libc_assert_fail needs to be stubbed out during rtld dependency analysis because the rtld rebuilds turn __libc_assert_fail into __assert_fail, which is unconditionally provided by elf/dl-minimal.c. This change is not possible for the public assert macro and its __assert_fail function because POSIX requires that the diagnostic is written to stderr. Reviewed-by: Adhemerval Zanella --- elf/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'elf') diff --git a/elf/Makefile b/elf/Makefile index fd77d0c7c8..3386f0ce77 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -1283,6 +1283,7 @@ $(objpfx)dl-allobjs.os: $(all-rtld-routines:%=$(objpfx)%.os) rtld-stubbed-symbols = \ __GI___pthread_disable_asynccancel \ __GI___pthread_enable_asynccancel \ + __libc_assert_fail \ __pthread_disable_asynccancel \ __pthread_enable_asynccancel \ calloc \ -- cgit v1.2.3-65-gdbad