Improve FORTIFY failure diagnostics.

Our FORTIFY _chk functions' implementations were very repetitive and verbose
but not very helpful. We'd also screwed up and put the SSIZE_MAX checks where
they would never fire unless you actually had a buffer as large as half your
address space, which probably doesn't happen very often.

Factor out the duplication and take the opportunity to actually show details
like how big the overrun buffer was, or by how much it was overrun.

Also remove the obsolete FORTIFY event logging.

Also remove the unused __libc_fatal_no_abort.

This change doesn't improve the diagnostics from the optimized assembler
implementations.

Change-Id: I176a90701395404d50975b547a00bd2c654e1252
diff --git a/libc/private/libc_logging.h b/libc/private/libc_logging.h
index e389565..4aa3ece 100644
--- a/libc/private/libc_logging.h
+++ b/libc/private/libc_logging.h
@@ -36,8 +36,6 @@
 
 __BEGIN_DECLS
 
-#include "libc_events.h"
-
 enum {
   ANDROID_LOG_UNKNOWN = 0,
   ANDROID_LOG_DEFAULT,    /* only for SetMinPriority() */
@@ -69,20 +67,11 @@
   char msg[0];
 };
 
-//
 // Formats a message to the log (priority 'fatal'), then aborts.
-//
+__LIBC_HIDDEN__ __noreturn void __libc_fatal(const char* fmt, ...) __printflike(1, 2);
 
-__LIBC_HIDDEN__ __noreturn void __libc_fatal(const char* format, ...) __printflike(1, 2);
-
-//
-// Formats a message to the log (priority 'fatal'), but doesn't abort.
-// Used by the malloc implementation to ensure that debuggerd dumps memory
-// around the bad address.
-//
-
-__LIBC_HIDDEN__ void __libc_fatal_no_abort(const char* format, ...)
-    __printflike(1, 2);
+// Formats a message to the log (priority 'fatal'), prefixed by "FORTIFY: ", then aborts.
+__LIBC_HIDDEN__ __noreturn void __fortify_fatal(const char* fmt, ...) __printflike(1, 2);
 
 //
 // Formatting routines for the C library's internal debugging.
@@ -103,15 +92,6 @@
 
 __LIBC_HIDDEN__ int __libc_write_log(int priority, const char* tag, const char* msg);
 
-//
-// Event logging.
-//
-
-__LIBC_HIDDEN__ void __libc_android_log_event_int(int32_t tag, int value);
-__LIBC_HIDDEN__ void __libc_android_log_event_uid(int32_t tag);
-
-__LIBC_HIDDEN__ __noreturn void __fortify_chk_fail(const char* msg, uint32_t event_tag);
-
 __END_DECLS
 
 #endif