2 * ld script for the x86 kernel
4 * Historic 32-bit version written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>
6 * Modernisation and unification done by Sam Ravnborg <sam@ravnborg.org>
9 * Don't define absolute symbols until and unless you know that symbol
10 * value is should remain constant even if kernel image is relocated
11 * at run time. Absolute symbols are not relocated. If symbol value should
12 * change if kernel is relocated, make the symbol section relative and
13 * put it inside the section definition.
17 #define LOAD_OFFSET __PAGE_OFFSET
19 #define LOAD_OFFSET __START_KERNEL_map
22 #include <asm-generic/vmlinux.lds.h>
23 #include <asm/asm-offsets.h>
24 #include <asm/thread_info.h>
25 #include <asm/page_types.h>
26 #include <asm/cache.h>
29 #undef i386 /* in case the preprocessor is a 32bit one */
31 OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT)
35 ENTRY(phys_startup_32)
38 OUTPUT_ARCH(i386:x86-64)
39 ENTRY(phys_startup_64)
45 # include "vmlinux_32.lds.S"
47 # include "vmlinux_64.lds.S"
52 ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE),
53 "kernel image bigger than KERNEL_IMAGE_SIZE")
56 * Per-cpu symbols which need to be offset from __per_cpu_load
57 * for the boot processor.
59 #define INIT_PER_CPU(x) init_per_cpu__##x = per_cpu__##x + __per_cpu_load
60 INIT_PER_CPU(gdt_page);
61 INIT_PER_CPU(irq_stack_union);
64 * Build-time check on the image size:
66 ASSERT((_end - _text <= KERNEL_IMAGE_SIZE),
67 "kernel image bigger than KERNEL_IMAGE_SIZE")
70 ASSERT((per_cpu__irq_stack_union == 0),
71 "irq_stack_union is not at start of per-cpu area");
74 #endif /* CONFIG_X86_32 */
77 #include <asm/kexec.h>
79 ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE,
80 "kexec control code size is too big")