From 48dcd0ba84c5a0fa08a0bd000b24af07d20dce44 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 15 Jun 2009 16:17:09 -0700 Subject: Preserve message printed before abort. The terminal output etc is not visible in a core file. The new libc-internal variable __abort_msg will point to a string with the message which has been printed before the abort in case abort is called from inside libc. BZ #10217 --- stdlib/Versions | 2 ++ stdlib/abort.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'stdlib') diff --git a/stdlib/Versions b/stdlib/Versions index 93c68f6e31..3e7b8921c4 100644 --- a/stdlib/Versions +++ b/stdlib/Versions @@ -104,5 +104,7 @@ libc { # functions which have an additional interface since they are # are cancelable. __libc_system; + # Variable which needs a dynamic symbol table entry. + __abort_msg; } } diff --git a/stdlib/abort.c b/stdlib/abort.c index 00788f22c7..3c188c9516 100644 --- a/stdlib/abort.c +++ b/stdlib/abort.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991,93,95,96,97,98,2001,02 Free Software Foundation, Inc. +/* Copyright (C) 1991,93,1995-1998,2001,02,2009 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 @@ -36,6 +36,10 @@ # define fflush(s) _IO_flush_all_lockp (0) #endif +/* Exported variable to locate abort message in core files etc. */ +char *__abort_msg __attribute__ ((nocommon)); +libc_hidden_def (__abort_msg) + /* We must avoid to run in circles. Therefore we remember how far we already got. */ static int stage; -- cgit v1.2.3