Simplify reloc

This commit is contained in:
Vladimir Serbinenko committed 2016-02-21 18:44:18 +01:00
1 parent 8af26e386c
commit f9ee0c3e5d
3 files changed
+6 -7

No files matched your search

-6
View File
@@ -123,12 +123,6 @@ reloc_done:
add r1, r1, #GRUB_KERNEL_MACHINE_STACK_SIZE add r1, r1, #GRUB_KERNEL_MACHINE_STACK_SIZE
and r1, r1, #~0x7 @ Ensure 8-byte alignment 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 sub sp, r1, #8
add r1, r1, #1024 add r1, r1, #1024
+1 -1
View File
@@ -26,7 +26,7 @@
#endif /* ! ASM_FILE */ #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) #define GRUB_KERNEL_MACHINE_HEAP_SIZE (grub_size_t) (16 * 1024 * 1024)
#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ #endif /* ! GRUB_KERNEL_MACHINE_HEADER */
+5
View File
@@ -1524,6 +1524,11 @@ finish_reloc_translation_pe (struct translate_context *ctx, struct grub_mkimage_
} }
layout->reloc_size = ctx->current_address; 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);
} }
/* /*