]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/kern/x86_64/efi/startup.S (_start): Align the stack to a
authorJosh Triplett <josh@joshtriplett.org>
Tue, 19 Nov 2013 13:31:40 +0000 (14:31 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Tue, 19 Nov 2013 13:31:40 +0000 (14:31 +0100)
16-byte boundary, as required by the x86-64 ABI, before calling
grub_main.  In some cases, GCC emits code that assumes this
alignment, which crashes if not aligned.  The EFI firmware is also
entitled to assume that stack alignment without checking.

ChangeLog
grub-core/kern/x86_64/efi/startup.S

index ca8ea2e5dda2e441fb9e81d19b3d00d43cd4fcb7..38a97db5bc28b0eeb9ea423f239437cc83bc3f39 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-11-19  Josh Triplett  <josh@joshtriplett.org>
+
+       * grub-core/kern/x86_64/efi/startup.S (_start): Align the stack to a
+       16-byte boundary, as required by the x86-64 ABI, before calling
+       grub_main.  In some cases, GCC emits code that assumes this
+       alignment, which crashes if not aligned.  The EFI firmware is also
+       entitled to assume that stack alignment without checking.
+
 2013-11-18  Josh Triplett  <josh@joshtriplett.org>
 
        * grub-core/mmap/efi/mmap.c (grub_mmap_register): Round up/down to
index f86f019699fc5e03c04024baad80ef742f9ae80c..9357e5c5ddaf143c0961be436523138269b4a618 100644 (file)
@@ -30,6 +30,6 @@ _start:
        movq    %rcx, EXT_C(grub_efi_image_handle)(%rip)
        movq    %rdx, EXT_C(grub_efi_system_table)(%rip)
 
+       andq    $~0xf, %rsp
        call    EXT_C(grub_main)
-       ret
-
+       /* Doesn't return.  */