summary refs log tree commit diff
path: root/stdlib
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2009-06-15 16:17:09 -0700
committerUlrich Drepper <drepper@redhat.com>2009-06-15 16:17:09 -0700
commit48dcd0ba84c5a0fa08a0bd000b24af07d20dce44 (patch)
tree846d0d74f1e00584a5973bb3eec4ee414314f436 /stdlib
parent6355c99740c91ed5a7fa14e378f74950e09f5f48 (diff)
downloadglibc-48dcd0ba84c5a0fa08a0bd000b24af07d20dce44.tar.gz
glibc-48dcd0ba84c5a0fa08a0bd000b24af07d20dce44.tar.xz
glibc-48dcd0ba84c5a0fa08a0bd000b24af07d20dce44.zip
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
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/Versions2
-rw-r--r--stdlib/abort.c6
2 files changed, 7 insertions, 1 deletions
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;