diff --git a/ChangeLog b/ChangeLog index f387a60f3..7949e3352 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-11 Vladimir Serbinenko + + * grub-core/lib/i386/relocator_common.S [__APPLE__ && __x86_64__]: Use + rip-relative addressing in prologue. + 2013-11-11 Vladimir Serbinenko * include/grub/misc.h [__APPLE__]: Do not add regparm(0) on x86_64. diff --git a/grub-core/lib/i386/relocator_common.S b/grub-core/lib/i386/relocator_common.S index b9d99e10e..03f427a03 100644 --- a/grub-core/lib/i386/relocator_common.S +++ b/grub-core/lib/i386/relocator_common.S @@ -42,7 +42,9 @@ LOCAL(base): /* %rax contains now our new 'base'. */ mov RAX, RSI -#ifdef __APPLE__ +#if defined (__APPLE__) && defined (__x86_64__) + leaq LOCAL(cont0) (%rip), RAX +#elif defined (__APPLE__) LOCAL(cont0_offset) = LOCAL(cont0) - LOCAL(base) add $LOCAL(cont0_offset), RAX #else