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) {
30 _etext = .; /* End of text section */
32 . = ALIGN(16); /* Exception table */
33 __start___ex_table = .;
34 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { *(__ex_table) }
35 __stop___ex_table = .;
40 .data : AT(ADDR(.data) - LOAD_OFFSET) { /* Data */
47 .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) { *(.data.nosave) }
52 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
57 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
58 *(.data.cacheline_aligned)
61 /* rarely changed data like cpu maps */
63 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { *(.data.read_mostly) }
64 _edata = .; /* End of data section */
66 . = ALIGN(THREAD_SIZE); /* init_task */
67 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
71 /* will be freed after init */
72 . = ALIGN(4096); /* Init code and data */
74 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
79 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
82 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) { *(.init.setup) }
85 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
95 __con_initcall_start = .;
96 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
99 __con_initcall_end = .;
102 __alt_instructions = .;
103 .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
106 __alt_instructions_end = .;
107 .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
108 *(.altinstr_replacement)
110 /* .exit.text is discard at runtime, not link time, to deal with references
111 from .altinstructions and .eh_frame */
112 .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
113 .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
115 __initramfs_start = .;
116 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) { *(.init.ramfs) }
120 .data.percpu : AT(ADDR(.data.percpu) - LOAD_OFFSET) { *(.data.percpu) }
124 /* freed after init ends here */
126 __bss_start = .; /* BSS */
127 .bss.page_aligned : AT(ADDR(.bss.page_aligned) - LOAD_OFFSET) {
130 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
138 /* This is where the kernel creates the early boot page tables */
142 /* Sections to be discarded */