--- arch/x86/boot/compressed/misc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) Index: linux-2.6/arch/x86/boot/compressed/misc.c =================================================================== --- linux-2.6.orig/arch/x86/boot/compressed/misc.c +++ linux-2.6/arch/x86/boot/compressed/misc.c @@ -235,8 +235,9 @@ static void error(char *x) asm("hlt"); } -#if CONFIG_X86_NEED_RELOCS -static void handle_relocations(void *output, unsigned long output_len) +#ifdef CONFIG_X86_NEED_RELOCS +static void handle_relocations(void *output_orig, void *output, + unsigned long output_len) { int *reloc; unsigned long delta, map, ptr; @@ -247,7 +248,7 @@ static void handle_relocations(void *out * Calculate the delta between where vmlinux was linked to load * and where it was actually loaded. */ - delta = min_addr - LOAD_PHYSICAL_ADDR; + delta = min_addr - (unsigned long)output_orig; if (!delta) { debug_putstr("No relocation needed... "); return; @@ -304,7 +305,8 @@ static void handle_relocations(void *out #endif } #else -static inline void handle_relocations(void *output, unsigned long output_len) +static inline void handle_relocations(void *output_orig, void *output, + unsigned long output_len) { } #endif @@ -365,6 +367,8 @@ asmlinkage void *decompress_kernel(void unsigned char *output, unsigned long output_len) { + unsigned char *output_orig = output; + real_mode = rmode; sanitize_boot_params(real_mode); @@ -417,7 +421,7 @@ asmlinkage void *decompress_kernel(void debug_putstr("... "); decompress(input_data, input_len, NULL, NULL, output, NULL, error); parse_elf(output); - handle_relocations(output, output_len); + handle_relocations(output_orig, output, output_len); debug_putstr("done.\nBooting the kernel.\n"); return output; }