diff --git a/ChangeLog b/ChangeLog index 4a8dab5c5..d9a362b6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2013-10-21 Vladimir Serbinenko + + * grub-core/kern/misc.c (grub_abort): Make static + 2013-10-21 Vladimir Serbinenko * grub-core/kern/misc.c (grub_vsnprintf_real): Don't attempt to diff --git a/grub-core/gdb/cstub.c b/grub-core/gdb/cstub.c index 3c89c1946..470fa917a 100644 --- a/grub-core/gdb/cstub.c +++ b/grub-core/gdb/cstub.c @@ -216,7 +216,7 @@ grub_gdb_trap (int trap_no) grub_backtrace_print_address ((void *) grub_gdb_regs[PC]); grub_printf ("\n"); grub_backtrace_pointer ((void *) grub_gdb_regs[EBP]); - grub_abort (); + grub_fatal ("Unhandled exception"); } sig_no = grub_gdb_trap2sig (trap_no); diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c index 77c9384d9..1409b5da9 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -511,7 +511,7 @@ grub_efi_mm_init (void) grub_printf ("printing memory map\n"); print_memory_map (memory_map, desc_size, NEXT_MEMORY_DESCRIPTOR (memory_map, map_size)); - grub_abort (); + grub_fatal ("Debug. "); #endif /* Release the memory maps. */ diff --git a/grub-core/kern/err.c b/grub-core/kern/err.c index 52ba6de62..53c734de7 100644 --- a/grub-core/kern/err.c +++ b/grub-core/kern/err.c @@ -47,18 +47,6 @@ grub_error (grub_err_t n, const char *fmt, ...) return n; } -void -grub_fatal (const char *fmt, ...) -{ - va_list ap; - - va_start (ap, fmt); - grub_vprintf (_(fmt), ap); - va_end (ap); - - grub_abort (); -} - void grub_error_push (void) { diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index 5af4582a0..bff44ff08 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -1067,7 +1067,7 @@ grub_xasprintf (const char *fmt, ...) } /* Abort GRUB. This function does not return. */ -void +static void __attribute__ ((noreturn)) grub_abort (void) { grub_printf ("\nAborted."); @@ -1083,10 +1083,17 @@ grub_abort (void) grub_exit (); } -#if ! defined (__APPLE__) && !defined (GRUB_UTIL) -/* GCC emits references to abort(). */ -void abort (void) __attribute__ ((alias ("grub_abort"))); -#endif +void +grub_fatal (const char *fmt, ...) +{ + va_list ap; + + va_start (ap, fmt); + grub_vprintf (_(fmt), ap); + va_end (ap); + + grub_abort (); +} #if NEED_REGISTER_FRAME_INFO && !defined(GRUB_UTIL) void __register_frame_info (void) diff --git a/grub-core/lib/libgcrypt_wrap/mem.c b/grub-core/lib/libgcrypt_wrap/mem.c index f9046f840..beeb661a3 100644 --- a/grub-core/lib/libgcrypt_wrap/mem.c +++ b/grub-core/lib/libgcrypt_wrap/mem.c @@ -115,7 +115,7 @@ void _gcry_log_bug (const char *fmt, ...) grub_vprintf (fmt, args); va_end (args); grub_refresh (); - grub_abort (); + grub_fatal ("gcrypt bug"); } gcry_err_code_t diff --git a/include/grub/misc.h b/include/grub/misc.h index 6707fe384..ed672fdf4 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -375,7 +375,6 @@ char *EXPORT_FUNC(grub_xasprintf) (const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 1, 2))) WARN_UNUSED_RESULT; char *EXPORT_FUNC(grub_xvasprintf) (const char *fmt, va_list args) WARN_UNUSED_RESULT; void EXPORT_FUNC(grub_exit) (void) __attribute__ ((noreturn)); -void EXPORT_FUNC(grub_abort) (void) __attribute__ ((noreturn)); grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r);