blob: 4710195b6b748e6cc69534f0f268e957a38edf58 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* ld script to make i386 Linux kernel
2 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
3 */
4
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -07005#define LOAD_OFFSET __PAGE_OFFSET
6
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#include <asm-generic/vmlinux.lds.h>
8#include <asm/thread_info.h>
9#include <asm/page.h>
10
11OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
12OUTPUT_ARCH(i386)
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070013ENTRY(phys_startup_32)
Linus Torvalds1da177e2005-04-16 15:20:36 -070014jiffies = jiffies_64;
15SECTIONS
16{
Eric W. Biederman3d345e32005-06-25 14:57:49 -070017 . = __KERNEL_START;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070018 phys_startup_32 = startup_32 - LOAD_OFFSET;
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 /* read-only */
20 _text = .; /* Text and read-only data */
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070021 .text : AT(ADDR(.text) - LOAD_OFFSET) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 *(.text)
23 SCHED_TEXT
24 LOCK_TEXT
Prasanna S Panchamukhi3d97ae52005-09-06 15:19:27 -070025 KPROBES_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 *(.fixup)
27 *(.gnu.warning)
28 } = 0x9090
29
30 _etext = .; /* End of text section */
31
32 . = ALIGN(16); /* Exception table */
33 __start___ex_table = .;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070034 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { *(__ex_table) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070035 __stop___ex_table = .;
36
37 RODATA
38
39 /* writeable */
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070040 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 *(.data)
42 CONSTRUCTORS
43 }
44
45 . = ALIGN(4096);
46 __nosave_begin = .;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070047 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 . = ALIGN(4096);
49 __nosave_end = .;
50
51 . = ALIGN(4096);
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070052 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
53 *(.data.idt)
54 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070055
56 . = ALIGN(32);
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070057 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
58 *(.data.cacheline_aligned)
59 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070060
Christoph Lameter6c036522005-07-07 17:56:59 -070061 /* rarely changed data like cpu maps */
62 . = ALIGN(32);
63 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { *(.data.read_mostly) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070064 _edata = .; /* End of data section */
65
66 . = ALIGN(THREAD_SIZE); /* init_task */
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070067 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
68 *(.data.init_task)
69 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
71 /* will be freed after init */
72 . = ALIGN(4096); /* Init code and data */
73 __init_begin = .;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070074 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 _sinittext = .;
76 *(.init.text)
77 _einittext = .;
78 }
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070079 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070080 . = ALIGN(16);
81 __setup_start = .;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070082 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { *(.init.setup) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070083 __setup_end = .;
84 __initcall_start = .;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070085 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
Linus Torvalds1da177e2005-04-16 15:20:36 -070086 *(.initcall1.init)
87 *(.initcall2.init)
88 *(.initcall3.init)
89 *(.initcall4.init)
90 *(.initcall5.init)
91 *(.initcall6.init)
92 *(.initcall7.init)
93 }
94 __initcall_end = .;
95 __con_initcall_start = .;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -070096 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
97 *(.con_initcall.init)
98 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070099 __con_initcall_end = .;
100 SECURITY_INIT
101 . = ALIGN(4);
102 __alt_instructions = .;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -0700103 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
104 *(.altinstructions)
105 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 __alt_instructions_end = .;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -0700107 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
108 *(.altinstr_replacement)
109 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700110 /* .exit.text is discard at runtime, not link time, to deal with references
111 from .altinstructions and .eh_frame */
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -0700112 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
113 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 . = ALIGN(4096);
115 __initramfs_start = .;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -0700116 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117 __initramfs_end = .;
118 . = ALIGN(32);
119 __per_cpu_start = .;
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -0700120 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121 __per_cpu_end = .;
122 . = ALIGN(4096);
123 __init_end = .;
124 /* freed after init ends here */
125
126 __bss_start = .; /* BSS */
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -0700127 .bss.page_aligned : AT(ADDR(.bss.page_aligned) - LOAD_OFFSET) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128 *(.bss.page_aligned)
Eric W. Biedermanad0d75e2005-06-25 14:57:47 -0700129 }
130 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131 *(.bss)
132 }
133 . = ALIGN(4);
134 __bss_stop = .;
135
136 _end = . ;
137
138 /* This is where the kernel creates the early boot page tables */
139 . = ALIGN(4096);
140 pg0 = .;
141
142 /* Sections to be discarded */
143 /DISCARD/ : {
144 *(.exitcall.exit)
145 }
146
Paolo 'Blaisorblade' Giarrussoa7d0c212005-09-10 19:44:54 +0200147 STABS_DEBUG
148
149 DWARF_DEBUG
Linus Torvalds1da177e2005-04-16 15:20:36 -0700150}