1 /* ld script to make i386 Linux kernel
2 * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
5 #define LOAD_OFFSET __PAGE_OFFSET
7 #include <asm-generic/vmlinux.lds.h>
8 #include <asm/thread_info.h>
10 #include <asm/cache.h>
12 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
14 ENTRY(phys_startup_32)
18 text PT_LOAD FLAGS(5); /* R_E */
19 data PT_LOAD FLAGS(7); /* RWE */
20 note PT_NOTE FLAGS(4); /* R__ */
25 phys_startup_32 = startup_32 - LOAD_OFFSET;
27 _text = .; /* Text and read-only data */
28 .text : AT(ADDR(.text) - LOAD_OFFSET) {
37 _etext = .; /* End of text section */
39 . = ALIGN(16); /* Exception table */
40 __start___ex_table = .;
41 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { *(__ex_table) }
42 __stop___ex_table = .;
47 __tracedata_start = .;
48 .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
54 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
61 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) }
66 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
71 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
72 *(.data.cacheline_aligned)
75 /* rarely changed data like cpu maps */
77 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { *(.data.read_mostly) }
78 _edata = .; /* End of data section */
80 #ifdef CONFIG_STACK_UNWIND
82 .eh_frame : AT(ADDR(.eh_frame) - LOAD_OFFSET) {
89 . = ALIGN(THREAD_SIZE); /* init_task */
90 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
94 /* might get freed after init */
97 __smp_alt_instructions = .;
98 .smp_altinstructions : AT(ADDR(.smp_altinstructions) - LOAD_OFFSET) {
99 *(.smp_altinstructions)
101 __smp_alt_instructions_end = .;
104 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
108 .smp_altinstr_replacement : AT(ADDR(.smp_altinstr_replacement) - LOAD_OFFSET) {
109 *(.smp_altinstr_replacement)
114 /* will be freed after init */
115 . = ALIGN(4096); /* Init code and data */
117 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
122 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
125 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { *(.init.setup) }
127 __initcall_start = .;
128 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
138 __con_initcall_start = .;
139 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
140 *(.con_initcall.init)
142 __con_initcall_end = .;
145 __alt_instructions = .;
146 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
149 __alt_instructions_end = .;
150 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
151 *(.altinstr_replacement)
153 /* .exit.text is discard at runtime, not link time, to deal with references
154 from .altinstructions and .eh_frame */
155 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
156 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
158 __initramfs_start = .;
159 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
161 . = ALIGN(L1_CACHE_BYTES);
163 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
167 /* freed after init ends here */
169 __bss_start = .; /* BSS */
170 .bss.page_aligned : AT(ADDR(.bss.page_aligned) - LOAD_OFFSET) {
173 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
181 /* This is where the kernel creates the early boot page tables */
185 /* Sections to be discarded */