1 | /* ld script to make i386 Linux kernel |
---|
2 | * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> |
---|
3 | * Modified for i386 Xen by Keir Fraser |
---|
4 | */ |
---|
5 | |
---|
6 | #include <xen/config.h> |
---|
7 | #include <asm/page.h> |
---|
8 | #include <asm/percpu.h> |
---|
9 | #undef ENTRY |
---|
10 | #undef ALIGN |
---|
11 | |
---|
12 | OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") |
---|
13 | OUTPUT_ARCH(i386) |
---|
14 | ENTRY(start) |
---|
15 | PHDRS |
---|
16 | { |
---|
17 | text PT_LOAD ; |
---|
18 | } |
---|
19 | SECTIONS |
---|
20 | { |
---|
21 | . = 0xFF000000 + 0x100000; |
---|
22 | _start = .; |
---|
23 | _stext = .; /* Text and read-only data */ |
---|
24 | .text : { |
---|
25 | *(.text) |
---|
26 | *(.fixup) |
---|
27 | *(.gnu.warning) |
---|
28 | } :text =0x9090 |
---|
29 | .text.lock : { *(.text.lock) } :text /* out-of-line lock text */ |
---|
30 | |
---|
31 | _etext = .; /* End of text section */ |
---|
32 | |
---|
33 | .rodata : { *(.rodata) *(.rodata.*) } :text |
---|
34 | |
---|
35 | . = ALIGN(32); /* Exception table */ |
---|
36 | __start___ex_table = .; |
---|
37 | __ex_table : { *(__ex_table) } :text |
---|
38 | __stop___ex_table = .; |
---|
39 | |
---|
40 | . = ALIGN(32); /* Pre-exception table */ |
---|
41 | __start___pre_ex_table = .; |
---|
42 | __pre_ex_table : { *(__pre_ex_table) } :text |
---|
43 | __stop___pre_ex_table = .; |
---|
44 | |
---|
45 | .data : { /* Data */ |
---|
46 | *(.data) |
---|
47 | CONSTRUCTORS |
---|
48 | } :text |
---|
49 | |
---|
50 | . = ALIGN(128); |
---|
51 | .data.read_mostly : { *(.data.read_mostly) } :text |
---|
52 | |
---|
53 | . = ALIGN(4096); /* Init code and data */ |
---|
54 | __init_begin = .; |
---|
55 | _sinittext = .; |
---|
56 | .init.text : { *(.init.text) } :text |
---|
57 | _einittext = .; |
---|
58 | .init.data : { *(.init.data) } :text |
---|
59 | . = ALIGN(32); |
---|
60 | __setup_start = .; |
---|
61 | .init.setup : { *(.init.setup) } :text |
---|
62 | __setup_end = .; |
---|
63 | __initcall_start = .; |
---|
64 | .initcall.init : { *(.initcall1.init) } :text |
---|
65 | __initcall_end = .; |
---|
66 | . = ALIGN(PAGE_SIZE); |
---|
67 | __init_end = .; |
---|
68 | |
---|
69 | __per_cpu_start = .; |
---|
70 | .data.percpu : { *(.data.percpu) } :text |
---|
71 | __per_cpu_data_end = .; |
---|
72 | . = __per_cpu_start + (NR_CPUS << PERCPU_SHIFT); |
---|
73 | . = ALIGN(STACK_SIZE); |
---|
74 | __per_cpu_end = .; |
---|
75 | |
---|
76 | __bss_start = .; /* BSS */ |
---|
77 | .bss : { |
---|
78 | *(.bss.stack_aligned) |
---|
79 | *(.bss.page_aligned) |
---|
80 | *(.bss) |
---|
81 | } :text |
---|
82 | _end = . ; |
---|
83 | |
---|
84 | /* Sections to be discarded */ |
---|
85 | /DISCARD/ : { |
---|
86 | *(.exit.text) |
---|
87 | *(.exit.data) |
---|
88 | *(.exitcall.exit) |
---|
89 | } |
---|
90 | |
---|
91 | /* Stabs debugging sections. */ |
---|
92 | .stab 0 : { *(.stab) } |
---|
93 | .stabstr 0 : { *(.stabstr) } |
---|
94 | .stab.excl 0 : { *(.stab.excl) } |
---|
95 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
96 | .stab.index 0 : { *(.stab.index) } |
---|
97 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
98 | .comment 0 : { *(.comment) } |
---|
99 | } |
---|