about summary refs log tree commit diff
path: root/debug/fortify_fail.c
diff options
context:
space:
mode:
Diffstat (limited to 'debug/fortify_fail.c')
-rw-r--r--debug/fortify_fail.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/debug/fortify_fail.c b/debug/fortify_fail.c
index a31977a40f..c90d384daf 100644
--- a/debug/fortify_fail.c
+++ b/debug/fortify_fail.c
@@ -17,17 +17,28 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdbool.h>
 
 
 extern char **__libc_argv attribute_hidden;
 
 void
 __attribute__ ((noreturn)) internal_function
-__fortify_fail (const char *msg)
+__fortify_fail_abort (_Bool do_backtrace, const char *msg)
 {
   /* The loop is added only to keep gcc happy.  */
   while (1)
-    __libc_message (2, "*** %s ***: %s terminated\n",
+    __libc_message (do_backtrace ? (do_abort | do_backtrace) : do_abort,
+		    "*** %s ***: %s terminated\n",
 		    msg, __libc_argv[0] ?: "<unknown>");
 }
+
+void
+__attribute__ ((noreturn)) internal_function
+__fortify_fail (const char *msg)
+{
+  __fortify_fail_abort (true, msg);
+}
+
 libc_hidden_def (__fortify_fail)
+libc_hidden_def (__fortify_fail_abort)