From 5982495738320f17938665d0a0a9407284f447dd Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Wed, 29 Feb 2012 14:48:58 +0100 Subject: [PATCH] * include/grub/symbol.h (EXT_C) [!ASM_FILE]: Redefine with strings. * grub-core/lib/i386/backtrace.c (grub_backtrace): Use EXT_C. --- ChangeLog | 5 +++++ grub-core/lib/i386/backtrace.c | 4 ++-- include/grub/symbol.h | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 149463d9d..479b4fc09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-02-29 Vladimir Serbinenko + + * include/grub/symbol.h (EXT_C) [!ASM_FILE]: Redefine with strings. + * grub-core/lib/i386/backtrace.c (grub_backtrace): Use EXT_C. + 2012-02-29 Vladimir Serbinenko * grub-core/gdb/i386/machdep.S: Use VARIABLE and EXT_C instead of diff --git a/grub-core/lib/i386/backtrace.c b/grub-core/lib/i386/backtrace.c index c673ea45e..7a7796a12 100644 --- a/grub-core/lib/i386/backtrace.c +++ b/grub-core/lib/i386/backtrace.c @@ -57,10 +57,10 @@ grub_backtrace (void) { #ifdef __x86_64__ asm volatile ("movq %rbp, %rdi\n" - "call grub_backtrace_pointer"); + "call " EXT_C("grub_backtrace_pointer")); #else asm volatile ("movl %ebp, %eax\n" - "call grub_backtrace_pointer"); + "call " EXT_C("grub_backtrace_pointer")); #endif } diff --git a/include/grub/symbol.h b/include/grub/symbol.h index ddbb9b53f..dcf5ca413 100644 --- a/include/grub/symbol.h +++ b/include/grub/symbol.h @@ -26,9 +26,14 @@ /* Add an underscore to a C symbol in assembler code if needed. */ #ifndef GRUB_UTIL + #if HAVE_ASM_USCORE +#ifdef ASM_FILE # define EXT_C(sym) _ ## sym #else +# define EXT_C(sym) "_" sym +#endif +#else # define EXT_C(sym) sym #endif