mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
* grub-core/loader/powerpc/ieee1275/linux.c (grub_linux_load32): Apply
loadmask before doing any calculations. Use correct type for offset. (grub_linux_load64): Likewise.
This commit is contained in:
1 parent
86205c94c3
commit
9da068a5dc
2 files changed
+17
-5
No files matched your search
@@ -1,3 +1,9 @@
|
|||||||
|
2011-01-11 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/loader/powerpc/ieee1275/linux.c (grub_linux_load32): Apply
|
||||||
|
loadmask before doing any calculations. Use correct type for offset.
|
||||||
|
(grub_linux_load64): Likewise.
|
||||||
|
|
||||||
2011-01-11 Colin Watson <cjwatson@ubuntu.com>
|
2011-01-11 Colin Watson <cjwatson@ubuntu.com>
|
||||||
|
|
||||||
* util/grub-mklayout.c (console_grub_equivalences_shift): Terminate
|
* util/grub-mklayout.c (console_grub_equivalences_shift): Terminate
|
||||||
|
|||||||
@@ -152,7 +152,8 @@ grub_linux_load32 (grub_elf_t elf)
|
|||||||
Elf32_Addr base_addr;
|
Elf32_Addr base_addr;
|
||||||
grub_addr_t seg_addr;
|
grub_addr_t seg_addr;
|
||||||
grub_uint32_t align;
|
grub_uint32_t align;
|
||||||
int offset;
|
grub_uint32_t offset;
|
||||||
|
Elf32_Addr entry;
|
||||||
|
|
||||||
linux_size = grub_elf32_size (elf, &base_addr, &align);
|
linux_size = grub_elf32_size (elf, &base_addr, &align);
|
||||||
if (linux_size == 0)
|
if (linux_size == 0)
|
||||||
@@ -160,9 +161,12 @@ grub_linux_load32 (grub_elf_t elf)
|
|||||||
/* Pad it; the kernel scribbles over memory beyond its load address. */
|
/* Pad it; the kernel scribbles over memory beyond its load address. */
|
||||||
linux_size += 0x100000;
|
linux_size += 0x100000;
|
||||||
|
|
||||||
offset = elf->ehdr.ehdr32.e_entry - base_addr;
|
/* Linux's entry point incorrectly contains a virtual address. */
|
||||||
|
entry = elf->ehdr.ehdr32.e_entry & ~ELF32_LOADMASK;
|
||||||
|
|
||||||
/* Linux's incorrectly contains a virtual address. */
|
/* Linux's incorrectly contains a virtual address. */
|
||||||
base_addr &= ~ELF32_LOADMASK;
|
base_addr &= ~ELF32_LOADMASK;
|
||||||
|
offset = entry - base_addr;
|
||||||
|
|
||||||
/* On some systems, firmware occupies the memory we're trying to use.
|
/* On some systems, firmware occupies the memory we're trying to use.
|
||||||
* Happily, Linux can be loaded anywhere (it relocates itself). Iterate
|
* Happily, Linux can be loaded anywhere (it relocates itself). Iterate
|
||||||
@@ -196,7 +200,8 @@ grub_linux_load64 (grub_elf_t elf)
|
|||||||
Elf64_Addr base_addr;
|
Elf64_Addr base_addr;
|
||||||
grub_addr_t seg_addr;
|
grub_addr_t seg_addr;
|
||||||
grub_uint64_t align;
|
grub_uint64_t align;
|
||||||
int offset;
|
grub_uint64_t offset;
|
||||||
|
Elf64_Addr entry;
|
||||||
|
|
||||||
linux_size = grub_elf64_size (elf, &base_addr, &align);
|
linux_size = grub_elf64_size (elf, &base_addr, &align);
|
||||||
if (linux_size == 0)
|
if (linux_size == 0)
|
||||||
@@ -204,9 +209,10 @@ grub_linux_load64 (grub_elf_t elf)
|
|||||||
/* Pad it; the kernel scribbles over memory beyond its load address. */
|
/* Pad it; the kernel scribbles over memory beyond its load address. */
|
||||||
linux_size += 0x100000;
|
linux_size += 0x100000;
|
||||||
|
|
||||||
offset = elf->ehdr.ehdr64.e_entry - base_addr;
|
|
||||||
/* Linux's incorrectly contains a virtual address. */
|
|
||||||
base_addr &= ~ELF64_LOADMASK;
|
base_addr &= ~ELF64_LOADMASK;
|
||||||
|
entry = elf->ehdr.ehdr64.e_entry & ~ELF64_LOADMASK;
|
||||||
|
offset = entry - base_addr;
|
||||||
|
/* Linux's incorrectly contains a virtual address. */
|
||||||
|
|
||||||
/* On some systems, firmware occupies the memory we're trying to use.
|
/* On some systems, firmware occupies the memory we're trying to use.
|
||||||
* Happily, Linux can be loaded anywhere (it relocates itself). Iterate
|
* Happily, Linux can be loaded anywhere (it relocates itself). Iterate
|
||||||
|
|||||||
Reference in new issue
Block a user