load_linux.c: when relocating, need to update code32_start
authorH. Peter Anvin <hpa@zytor.com>
Tue, 5 May 2009 00:34:46 +0000 (17:34 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Tue, 5 May 2009 00:34:46 +0000 (17:34 -0700)
The normal value for code32_start is based on the kernel load address
(in fact, it usually *is* the kernel load address); accordingly, it
needs to be updated if the kernel is relocated.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
com32/lib/syslinux/load_linux.c

index b1667f0..5df5f5e 100644 (file)
@@ -380,6 +380,7 @@ int syslinux_boot_linux(void *kernel_buf, size_t kernel_size,
         however, account for the fact that the kernel is decompressed
         into a whole other place, either. */
       if (end - start >= 3*prot_mode_size) {
+       whdr->code32_start += start - prot_mode_base;
        prot_mode_base = start;
        ok = true;
        break;