]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/x86/kernel/vmlinux_32.lds.S
x86, vmlinux.lds: unify .text output sections
[karo-tx-linux.git] / arch / x86 / kernel / vmlinux_32.lds.S
1         /* Exception table */
2         . = ALIGN(16);
3         __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
4                 __start___ex_table = .;
5                  *(__ex_table)
6                 __stop___ex_table = .;
7         } :text = 0x9090
8
9         RODATA
10
11         /* writeable */
12         . = ALIGN(PAGE_SIZE);
13         /* Data */
14         .data : AT(ADDR(.data) - LOAD_OFFSET) {
15                 DATA_DATA
16                 CONSTRUCTORS
17         } :data
18
19         . = ALIGN(PAGE_SIZE);
20         .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
21                 __nosave_begin = .;
22                 *(.data.nosave)
23                 . = ALIGN(PAGE_SIZE);
24                 __nosave_end = .;
25         }
26
27         . = ALIGN(PAGE_SIZE);
28         .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
29                 *(.data.page_aligned)
30                 *(.data.idt)
31         }
32
33         . = ALIGN(32);
34         .data.cacheline_aligned :
35                 AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
36                 *(.data.cacheline_aligned)
37         }
38
39         /* rarely changed data like cpu maps */
40         . = ALIGN(32);
41         .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
42                 *(.data.read_mostly)
43
44                 /* End of data section */
45                 _edata = .;
46         }
47
48         /* init_task */
49         . = ALIGN(THREAD_SIZE);
50         .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
51                 *(.data.init_task)
52         }
53
54         . = ALIGN(PAGE_SIZE);
55         .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
56                 /* might get freed after init */
57                 __smp_locks = .;
58                 *(.smp_locks)
59                 __smp_locks_end = .;
60         }
61         /* will be freed after init
62          * Following ALIGN() is required to make sure no other data falls on the
63          * same page where __smp_alt_end is pointing as that page might be freed
64          * after boot. Always make sure that ALIGN() directive is present after
65          * the section which contains __smp_alt_end.
66          */
67         . = ALIGN(PAGE_SIZE);
68
69         /* Init code and data - will be freed after init */
70         . = ALIGN(PAGE_SIZE);
71         .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
72                 __init_begin = .;
73                 _sinittext = .;
74                 INIT_TEXT
75                 _einittext = .;
76         }
77
78         .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
79                 INIT_DATA
80         }
81
82         . = ALIGN(16);
83         .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
84                 __setup_start = .;
85                 *(.init.setup)
86                 __setup_end = .;
87         }
88         .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
89                 __initcall_start = .;
90                 INITCALLS
91                 __initcall_end = .;
92         }
93
94         .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
95                 __con_initcall_start = .;
96                 *(.con_initcall.init)
97                 __con_initcall_end = .;
98         }
99
100         .x86_cpu_dev.init : AT(ADDR(.x86_cpu_dev.init) - LOAD_OFFSET) {
101                 __x86_cpu_dev_start = .;
102                 *(.x86_cpu_dev.init)
103                 __x86_cpu_dev_end = .;
104         }
105
106         SECURITY_INIT
107
108         . = ALIGN(4);
109         .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
110                 __alt_instructions = .;
111                 *(.altinstructions)
112                 __alt_instructions_end = .;
113         }
114
115         .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
116                 *(.altinstr_replacement)
117         }
118
119         . = ALIGN(4);
120         .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
121                 __parainstructions = .;
122                 *(.parainstructions)
123                 __parainstructions_end = .;
124         }
125
126         /*
127          * .exit.text is discard at runtime, not link time, to deal with
128          *  references from .altinstructions and .eh_frame
129          */
130         .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
131                 EXIT_TEXT
132         }
133
134         .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) {
135                 EXIT_DATA
136         }
137
138 #if defined(CONFIG_BLK_DEV_INITRD)
139         . = ALIGN(PAGE_SIZE);
140         .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
141                 __initramfs_start = .;
142                 *(.init.ramfs)
143                 __initramfs_end = .;
144         }
145 #endif
146
147         PERCPU(PAGE_SIZE)
148
149         . = ALIGN(PAGE_SIZE);
150         /* freed after init ends here */
151
152         /* BSS */
153         .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
154                 __init_end = .;
155                 __bss_start = .;
156                 *(.bss.page_aligned)
157                 *(.bss)
158                 . = ALIGN(4);
159                 __bss_stop = .;
160         }
161
162         .brk : AT(ADDR(.brk) - LOAD_OFFSET) {
163                 . = ALIGN(PAGE_SIZE);
164                 __brk_base = .;
165                 . += 64 * 1024;         /* 64k alignment slop space */
166                 *(.brk_reservation)     /* areas brk users have reserved */
167                 __brk_limit = .;
168         }
169
170         .end : AT(ADDR(.end) - LOAD_OFFSET) {
171                 _end = . ;
172         }
173
174         /* Sections to be discarded */
175         /DISCARD/ : {
176                 *(.exitcall.exit)
177                 *(.discard)
178         }