From 4c9b7f3c21ff21c199e54bfad2fdf3445fa4573d Mon Sep 17 00:00:00 2001 From: Carmelo Amoroso Date: Tue, 3 Jan 2012 19:09:56 +0100 Subject: libc: allow to backtrace out of abort call Build raise and abort function with dwarf2 info by using -fasynchronous-unwind-tables to make backtrace() working across a call to abort. A scenario where it could be useful is within a signal handler that wants to dump a backtrace when catching some signal (i.e SIGABRT). Without having abort & raise built with DWARF2 information, it is not possible for the libgcc stack unwinder to walk through the call stack out of the abort/raise function. Impacts in terms of size are really limited Current text data bss dec hex filename 164 0 0 164 a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os 164 0 0 164 a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS 220 24 4 248 f8 ./libc/stdlib/abort.os With (-fasynchronous-unwind-tables) text data bss dec hex filename 216 0 0 216 d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os 216 0 0 216 d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS 280 24 4 308 134 ./libc/stdlib/abort.os Signed-off-by: Carmelo Amoroso Acked-by: Bernhard Reutner-Fischer --- libc/signal/Makefile.in | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libc/signal') diff --git a/libc/signal/Makefile.in b/libc/signal/Makefile.in index a7e307871..ed8598b07 100644 --- a/libc/signal/Makefile.in +++ b/libc/signal/Makefile.in @@ -24,6 +24,8 @@ ifneq ($(strip $(ARCH_OBJS)),) CSRC-y := $(filter-out $(notdir $(ARCH_OBJS:.o=.c)),$(CSRC-y)) endif +CFLAGS-raise.c = -fasynchronous-unwind-tables + SIGNAL_DIR := $(top_srcdir)libc/signal SIGNAL_OUT := $(top_builddir)libc/signal -- cgit v1.2.3