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)
19 phys_startup_32 = startup_32 - LOAD_OFFSET;
21 _text = .; /* Text and read-only data */
22 .text : AT(ADDR(.text) - LOAD_OFFSET) {
31 _etext = .; /* End of text section */
33 . = ALIGN(16); /* Exception table */
34 __start___ex_table = .;
35 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { *(__ex_table) }
36 __stop___ex_table = .;
41 __tracedata_start = .;
42 .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
48 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
55 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) }
60 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
65 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
66 *(.data.cacheline_aligned)
69 /* rarely changed data like cpu maps */
71 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { *(.data.read_mostly) }
72 _edata = .; /* End of data section */
74 #ifdef CONFIG_STACK_UNWIND
76 .eh_frame : AT(ADDR(.eh_frame) - LOAD_OFFSET) {
83 . = ALIGN(THREAD_SIZE); /* init_task */
84 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
88 /* might get freed after init */
91 __smp_alt_instructions = .;
92 .smp_altinstructions : AT(ADDR(.smp_altinstructions) - LOAD_OFFSET) {
93 *(.smp_altinstructions)
95 __smp_alt_instructions_end = .;
98 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
102 .smp_altinstr_replacement : AT(ADDR(.smp_altinstr_replacement) - LOAD_OFFSET) {
103 *(.smp_altinstr_replacement)
108 /* will be freed after init */
109 . = ALIGN(4096); /* Init code and data */
111 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
116 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
119 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { *(.init.setup) }
121 __initcall_start = .;
122 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
132 __con_initcall_start = .;
133 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
134 *(.con_initcall.init)
136 __con_initcall_end = .;
139 __alt_instructions = .;
140 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
143 __alt_instructions_end = .;
144 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
145 *(.altinstr_replacement)
147 /* .exit.text is discard at runtime, not link time, to deal with references
148 from .altinstructions and .eh_frame */
149 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
150 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
152 __initramfs_start = .;
153 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
155 . = ALIGN(L1_CACHE_BYTES);
157 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
161 /* freed after init ends here */
163 __bss_start = .; /* BSS */
164 .bss.page_aligned : AT(ADDR(.bss.page_aligned) - LOAD_OFFSET) {
167 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
175 /* This is where the kernel creates the early boot page tables */
179 /* Sections to be discarded */