2009-03-11 Robert Millan <rmh@aybabtu.com>
* loader/i386/multiboot.c (code_size): New variable. (grub_multiboot): Define offsets by adding to `code_size' rather than substracting from `grub_multiboot_payload_size'. Provide 4-byte alignment to MBI and others by increasing `boot_loader_name_length' appropiately. * loader/i386/multiboot_elfxx.c (CONCAT(grub_multiboot_load_elf, XX)): Initialize `code_size'.
This commit is contained in:
parent
6377ef3a1d
commit
1ca7fc96f7
3 changed files with 32 additions and 15 deletions
|
@ -88,9 +88,10 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer)
|
|||
if (phdr(i)->p_paddr > phdr(highest_segment)->p_paddr)
|
||||
highest_segment = i;
|
||||
}
|
||||
grub_multiboot_payload_size += (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr;
|
||||
code_size = (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr;
|
||||
grub_multiboot_payload_dest = phdr(lowest_segment)->p_paddr;
|
||||
|
||||
grub_multiboot_payload_size += code_size;
|
||||
playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward));
|
||||
if (! playground)
|
||||
return grub_errno;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue