From 8445b0115f365903a8c8f005dd53cb3d969b87ad Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 11 Nov 2013 23:02:51 +0100 Subject: [PATCH] * grub-core/lib/i386/relocator_common.S [__APPLE__ && __x86_64__]: Use rip-relative addressing in prologue. --- ChangeLog | 5 +++++ grub-core/lib/i386/relocator_common.S | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) 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