* grub-core/lib/i386/relocator_common.S [__APPLE__ && __x86_64__]: Use

rip-relative addressing in prologue.
This commit is contained in:
Vladimir Serbinenko 2013-11-11 23:02:51 +01:00
parent 8506a64149
commit 8445b0115f
2 changed files with 8 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2013-11-11 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/lib/i386/relocator_common.S [__APPLE__ && __x86_64__]: Use
rip-relative addressing in prologue.
2013-11-11 Vladimir Serbinenko <phcoder@gmail.com> 2013-11-11 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/misc.h [__APPLE__]: Do not add regparm(0) on x86_64. * include/grub/misc.h [__APPLE__]: Do not add regparm(0) on x86_64.

View file

@ -42,7 +42,9 @@ LOCAL(base):
/* %rax contains now our new 'base'. */ /* %rax contains now our new 'base'. */
mov RAX, RSI 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) LOCAL(cont0_offset) = LOCAL(cont0) - LOCAL(base)
add $LOCAL(cont0_offset), RAX add $LOCAL(cont0_offset), RAX
#else #else