]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Simplify reloc
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 21 Feb 2016 17:44:18 +0000 (18:44 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Sun, 21 Feb 2016 17:44:18 +0000 (18:44 +0100)
grub-core/kern/arm/startup.S
include/grub/arm/uboot/kernel.h
util/grub-mkimagexx.c

index 8e233d4ecf750c0d692503dc9464df8d76f1d08c..fd56b31a6bca81359aedfbb8e14c5279ea1a3561 100644 (file)
@@ -122,12 +122,6 @@ reloc_done:
 
        add     r1, r1, #GRUB_KERNEL_MACHINE_STACK_SIZE
        and     r1, r1, #~0x7   @ Ensure 8-byte alignment
-
-       @ Do not put modules before the end of relocations.
-       @ Instead increase stack size
-       @ r1 = max (r1, r0)
-        cmp     r0, r1
-        movcs   r1, r0
        
        sub     sp, r1, #8
        add     r1, r1, #1024
index 06e543324da76bcffbca0f9b77317c094cfd3d45..ce0b149cc6015a32277a579aed2eeef93ade8311 100644 (file)
@@ -26,7 +26,7 @@
 
 #endif /* ! ASM_FILE */
 
-#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000
+#define GRUB_KERNEL_MACHINE_STACK_SIZE GRUB_KERNEL_ARM_STACK_SIZE
 #define GRUB_KERNEL_MACHINE_HEAP_SIZE  (grub_size_t) (16 * 1024 * 1024)
 
 #endif /* ! GRUB_KERNEL_MACHINE_HEADER */
index 34878c97f631c5401296fa9a93617ae5795f7499..a6763d7561d7a0838c8684ea4f4acd8ff99ca398 100644 (file)
@@ -1524,6 +1524,11 @@ finish_reloc_translation_pe (struct translate_context *ctx, struct grub_mkimage_
     }
 
   layout->reloc_size = ctx->current_address;
+  if (image_target->elf_target == EM_ARM && layout->reloc_size > GRUB_KERNEL_ARM_STACK_SIZE)
+    grub_util_error ("Reloc section (%d) is bigger than stack size (%d). "
+                    "This breaks assembly assumptions. Please increase stack size",
+                    (int) layout->reloc_size,
+                    (int) GRUB_KERNEL_ARM_STACK_SIZE);
 }
 
 /*