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) {
55 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
62 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) }
67 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
72 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
73 *(.data.cacheline_aligned)
76 /* rarely changed data like cpu maps */
78 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { *(.data.read_mostly) }
79 _edata = .; /* End of data section */
81 #ifdef CONFIG_STACK_UNWIND
83 .eh_frame : AT(ADDR(.eh_frame) - LOAD_OFFSET) {
90 . = ALIGN(THREAD_SIZE); /* init_task */
91 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
95 /* might get freed after init */
98 __smp_alt_instructions = .;
99 .smp_altinstructions : AT(ADDR(.smp_altinstructions) - LOAD_OFFSET) {
100 *(.smp_altinstructions)
102 __smp_alt_instructions_end = .;
105 .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
109 .smp_altinstr_replacement : AT(ADDR(.smp_altinstr_replacement) - LOAD_OFFSET) {
110 *(.smp_altinstr_replacement)
115 /* will be freed after init */
116 . = ALIGN(4096); /* Init code and data */
118 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
123 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
126 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { *(.init.setup) }
128 __initcall_start = .;
129 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
133 __con_initcall_start = .;
134 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
135 *(.con_initcall.init)
137 __con_initcall_end = .;
140 __alt_instructions = .;
141 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
144 __alt_instructions_end = .;
145 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
146 *(.altinstr_replacement)
148 /* .exit.text is discard at runtime, not link time, to deal with references
149 from .altinstructions and .eh_frame */
150 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
151 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
153 __initramfs_start = .;
154 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
156 . = ALIGN(L1_CACHE_BYTES);
158 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
162 /* freed after init ends here */
164 __bss_start = .; /* BSS */
165 .bss.page_aligned : AT(ADDR(.bss.page_aligned) - LOAD_OFFSET) {
168 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
176 /* This is where the kernel creates the early boot page tables */
180 /* Sections to be discarded */