aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/vmlinux.lds.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/vmlinux.lds.S')
-rw-r--r--arch/arm/kernel/vmlinux.lds.S141
1 files changed, 78 insertions, 63 deletions
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index e5287f21bad..4e66f62b8d4 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -23,8 +23,10 @@
23 23
24#if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK) 24#if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)
25#define ARM_EXIT_KEEP(x) x 25#define ARM_EXIT_KEEP(x) x
26#define ARM_EXIT_DISCARD(x)
26#else 27#else
27#define ARM_EXIT_KEEP(x) 28#define ARM_EXIT_KEEP(x)
29#define ARM_EXIT_DISCARD(x) x
28#endif 30#endif
29 31
30OUTPUT_ARCH(arm) 32OUTPUT_ARCH(arm)
@@ -38,58 +40,12 @@ jiffies = jiffies_64 + 4;
38 40
39SECTIONS 41SECTIONS
40{ 42{
41#ifdef CONFIG_XIP_KERNEL
42 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
43#else
44 . = PAGE_OFFSET + TEXT_OFFSET;
45#endif
46
47 .init : { /* Init code and data */
48 _stext = .;
49 _sinittext = .;
50 HEAD_TEXT
51 INIT_TEXT
52 ARM_EXIT_KEEP(EXIT_TEXT)
53 _einittext = .;
54 ARM_CPU_DISCARD(PROC_INFO)
55 __arch_info_begin = .;
56 *(.arch.info.init)
57 __arch_info_end = .;
58 __tagtable_begin = .;
59 *(.taglist.init)
60 __tagtable_end = .;
61#ifdef CONFIG_SMP_ON_UP
62 __smpalt_begin = .;
63 *(.alt.smp.init)
64 __smpalt_end = .;
65#endif
66
67 __pv_table_begin = .;
68 *(.pv_table)
69 __pv_table_end = .;
70
71 INIT_SETUP(16)
72
73 INIT_CALLS
74 CON_INITCALL
75 SECURITY_INITCALL
76 INIT_RAM_FS
77
78#ifndef CONFIG_XIP_KERNEL
79 __init_begin = _stext;
80 INIT_DATA
81 ARM_EXIT_KEEP(EXIT_DATA)
82#endif
83 }
84
85 PERCPU_SECTION(32)
86
87#ifndef CONFIG_XIP_KERNEL
88 . = ALIGN(PAGE_SIZE);
89 __init_end = .;
90#endif
91
92 /* 43 /*
44 * XXX: The linker does not define how output sections are
45 * assigned to input sections when there are multiple statements
46 * matching the same input section name. There is no documented
47 * order of matching.
48 *
93 * unwind exit sections must be discarded before the rest of the 49 * unwind exit sections must be discarded before the rest of the
94 * unwind sections get included. 50 * unwind sections get included.
95 */ 51 */
@@ -98,6 +54,9 @@ SECTIONS
98 *(.ARM.extab.exit.text) 54 *(.ARM.extab.exit.text)
99 ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text)) 55 ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text))
100 ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text)) 56 ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text))
57 ARM_EXIT_DISCARD(EXIT_TEXT)
58 ARM_EXIT_DISCARD(EXIT_DATA)
59 EXIT_CALL
101#ifndef CONFIG_HOTPLUG 60#ifndef CONFIG_HOTPLUG
102 *(.ARM.exidx.devexit.text) 61 *(.ARM.exidx.devexit.text)
103 *(.ARM.extab.devexit.text) 62 *(.ARM.extab.devexit.text)
@@ -106,10 +65,24 @@ SECTIONS
106 *(.fixup) 65 *(.fixup)
107 *(__ex_table) 66 *(__ex_table)
108#endif 67#endif
68#ifndef CONFIG_SMP_ON_UP
69 *(.alt.smp.init)
70#endif
71 *(.discard)
72 *(.discard.*)
109 } 73 }
110 74
75#ifdef CONFIG_XIP_KERNEL
76 . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR);
77#else
78 . = PAGE_OFFSET + TEXT_OFFSET;
79#endif
80 .head.text : {
81 _text = .;
82 HEAD_TEXT
83 }
111 .text : { /* Real text segment */ 84 .text : { /* Real text segment */
112 _text = .; /* Text and read-only data */ 85 _stext = .; /* Text and read-only data */
113 __exception_text_start = .; 86 __exception_text_start = .;
114 *(.exception.text) 87 *(.exception.text)
115 __exception_text_end = .; 88 __exception_text_end = .;
@@ -122,8 +95,6 @@ SECTIONS
122 *(.fixup) 95 *(.fixup)
123#endif 96#endif
124 *(.gnu.warning) 97 *(.gnu.warning)
125 *(.rodata)
126 *(.rodata.*)
127 *(.glue_7) 98 *(.glue_7)
128 *(.glue_7t) 99 *(.glue_7t)
129 . = ALIGN(4); 100 . = ALIGN(4);
@@ -152,10 +123,63 @@ SECTIONS
152 123
153 _etext = .; /* End of text and rodata section */ 124 _etext = .; /* End of text and rodata section */
154 125
126#ifndef CONFIG_XIP_KERNEL
127 . = ALIGN(PAGE_SIZE);
128 __init_begin = .;
129#endif
130
131 INIT_TEXT_SECTION(8)
132 .exit.text : {
133 ARM_EXIT_KEEP(EXIT_TEXT)
134 }
135 .init.proc.info : {
136 ARM_CPU_DISCARD(PROC_INFO)
137 }
138 .init.arch.info : {
139 __arch_info_begin = .;
140 *(.arch.info.init)
141 __arch_info_end = .;
142 }
143 .init.tagtable : {
144 __tagtable_begin = .;
145 *(.taglist.init)
146 __tagtable_end = .;
147 }
148#ifdef CONFIG_SMP_ON_UP
149 .init.smpalt : {
150 __smpalt_begin = .;
151 *(.alt.smp.init)
152 __smpalt_end = .;
153 }
154#endif
155 .init.pv_table : {
156 __pv_table_begin = .;
157 *(.pv_table)
158 __pv_table_end = .;
159 }
160 .init.data : {
161#ifndef CONFIG_XIP_KERNEL
162 INIT_DATA
163#endif
164 INIT_SETUP(16)
165 INIT_CALLS
166 CON_INITCALL
167 SECURITY_INITCALL
168 INIT_RAM_FS
169 }
170#ifndef CONFIG_XIP_KERNEL
171 .exit.data : {
172 ARM_EXIT_KEEP(EXIT_DATA)
173 }
174#endif
175
176 PERCPU_SECTION(32)
177
155#ifdef CONFIG_XIP_KERNEL 178#ifdef CONFIG_XIP_KERNEL
156 __data_loc = ALIGN(4); /* location in binary */ 179 __data_loc = ALIGN(4); /* location in binary */
157 . = PAGE_OFFSET + TEXT_OFFSET; 180 . = PAGE_OFFSET + TEXT_OFFSET;
158#else 181#else
182 __init_end = .;
159 . = ALIGN(THREAD_SIZE); 183 . = ALIGN(THREAD_SIZE);
160 __data_loc = .; 184 __data_loc = .;
161#endif 185#endif
@@ -267,15 +291,6 @@ SECTIONS
267 291
268 STABS_DEBUG 292 STABS_DEBUG
269 .comment 0 : { *(.comment) } 293 .comment 0 : { *(.comment) }
270
271 /* Default discards */
272 DISCARDS
273
274#ifndef CONFIG_SMP_ON_UP
275 /DISCARD/ : {
276 *(.alt.smp.init)
277 }
278#endif
279} 294}
280 295
281/* 296/*