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>
11 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
13 ENTRY(phys_startup_32)
18 phys_startup_32 = startup_32 - LOAD_OFFSET;
20 _text = .; /* Text and read-only data */
21 .text : AT(ADDR(.text) - LOAD_OFFSET) {
29 _etext = .; /* End of text section */
31 . = ALIGN(16); /* Exception table */
32 __start___ex_table = .;
33 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { *(__ex_table) }
34 __stop___ex_table = .;
39 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
46 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) }
51 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
56 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
57 *(.data.cacheline_aligned)
60 /* rarely changed data like cpu maps */
62 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { *(.data.read_mostly) }
63 _edata = .; /* End of data section */
65 . = ALIGN(THREAD_SIZE); /* init_task */
66 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
70 /* will be freed after init */
71 . = ALIGN(4096); /* Init code and data */
73 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
78 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
81 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { *(.init.setup) }
84 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
94 __con_initcall_start = .;
95 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
98 __con_initcall_end = .;
101 __alt_instructions = .;
102 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
105 __alt_instructions_end = .;
106 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
107 *(.altinstr_replacement)
109 /* .exit.text is discard at runtime, not link time, to deal with references
110 from .altinstructions and .eh_frame */
111 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
112 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
114 __initramfs_start = .;
115 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
119 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
123 /* freed after init ends here */
125 __bss_start = .; /* BSS */
126 .bss.page_aligned : AT(ADDR(.bss.page_aligned) - LOAD_OFFSET) {
129 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
137 /* This is where the kernel creates the early boot page tables */
141 /* Sections to be discarded */
146 /* Stabs debugging sections. */
147 .stab 0 : { *(.stab) }
148 .stabstr 0 : { *(.stabstr) }
149 .stab.excl 0 : { *(.stab.excl) }
150 .stab.exclstr 0 : { *(.stab.exclstr) }
151 .stab.index 0 : { *(.stab.index) }
152 .stab.indexstr 0 : { *(.stab.indexstr) }
153 .comment 0 : { *(.comment) }