@@ -45,24 +45,16 @@ jiffies = jiffies_64;
4545 LONG(sym ## _end); \
4646 LONG(LOADADDR(section))
4747
48- /* Macro to define a section for a vector.
49- *
50- * Use of the MIN function catches the types of errors illustrated in
51- * the following example:
52- *
53- * Assume the section .DoubleExceptionVector.literal is completely
54- * full. Then a programmer adds code to .DoubleExceptionVector.text
55- * that produces another literal. The final literal position will
56- * overlay onto the first word of the adjacent code section
57- * .DoubleExceptionVector.text. (In practice, the literals will
58- * overwrite the code, and the first few instructions will be
59- * garbage.)
48+ /*
49+ * Macro to define a section for a vector. When CONFIG_VECTORS_OFFSET is
50+ * defined code for every vector is located with other init data. At startup
51+ * time head.S copies code for every vector to its final position according
52+ * to description recorded in the corresponding RELOCATE_ENTRY.
6053 */
6154
6255#ifdef CONFIG_VECTORS_OFFSET
63- #define SECTION_VECTOR(sym, section, addr, max_prevsec_size, prevsec) \
64- section addr : AT((MIN(LOADADDR(prevsec) + max_prevsec_size, \
65- LOADADDR(prevsec) + SIZEOF(prevsec)) + 3 ) & ~ 3 ) \
56+ #define SECTION_VECTOR(sym, section, addr, prevsec) \
57+ section addr : AT(((LOADADDR(prevsec) + SIZEOF(prevsec)) + 3 ) & ~ 3 ) \
6658 { \
6759 . = ALIGN(4 ); \
6860 sym ## _start = ABSOLUTE(.); \
@@ -112,26 +104,19 @@ SECTIONS
112104#if XCHAL_EXCM_LEVEL >= 6
113105 SECTION_VECTOR (.Level6InterruptVector.text, INTLEVEL6_VECTOR_VADDR)
114106#endif
115- SECTION_VECTOR (.DebugInterruptVector.literal, DEBUG_VECTOR_VADDR - 4 )
116107 SECTION_VECTOR (.DebugInterruptVector.text, DEBUG_VECTOR_VADDR)
117- SECTION_VECTOR (.KernelExceptionVector.literal, KERNEL_VECTOR_VADDR - 4 )
118108 SECTION_VECTOR (.KernelExceptionVector.text, KERNEL_VECTOR_VADDR)
119- SECTION_VECTOR (.UserExceptionVector.literal, USER_VECTOR_VADDR - 4 )
120109 SECTION_VECTOR (.UserExceptionVector.text, USER_VECTOR_VADDR)
121- SECTION_VECTOR (.DoubleExceptionVector.literal, DOUBLEEXC_VECTOR_VADDR - 20 )
122110 SECTION_VECTOR (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR)
123111#endif
124112
113+ IRQENTRY_TEXT
114+ SOFTIRQENTRY_TEXT
115+ ENTRY_TEXT
125116 TEXT_TEXT
126- VMLINUX_SYMBOL(__sched_text_start) = .;
127- *(.sched.literal .sched.text)
128- VMLINUX_SYMBOL(__sched_text_end) = .;
129- VMLINUX_SYMBOL(__cpuidle_text_start) = .;
130- *(.cpuidle.literal .cpuidle.text)
131- VMLINUX_SYMBOL(__cpuidle_text_end) = .;
132- VMLINUX_SYMBOL(__lock_text_start) = .;
133- *(.spinlock.literal .spinlock.text)
134- VMLINUX_SYMBOL(__lock_text_end) = .;
117+ SCHED_TEXT
118+ CPUIDLE_TEXT
119+ LOCK_TEXT
135120
136121 }
137122 _etext = .;
@@ -196,8 +181,6 @@ SECTIONS
196181 .KernelExceptionVector.text);
197182 RELOCATE_ENTRY(_UserExceptionVector_text,
198183 .UserExceptionVector.text);
199- RELOCATE_ENTRY(_DoubleExceptionVector_literal,
200- .DoubleExceptionVector.literal);
201184 RELOCATE_ENTRY(_DoubleExceptionVector_text,
202185 .DoubleExceptionVector.text);
203186 RELOCATE_ENTRY(_DebugInterruptVector_text,
@@ -230,90 +213,67 @@ SECTIONS
230213
231214 SECTION_VECTOR (_WindowVectors_text,
232215 .WindowVectors.text,
233- WINDOW_VECTORS_VADDR, 4 ,
216+ WINDOW_VECTORS_VADDR,
234217 .dummy)
235- SECTION_VECTOR (_DebugInterruptVector_literal,
236- .DebugInterruptVector.literal,
237- DEBUG_VECTOR_VADDR - 4 ,
238- SIZEOF(.WindowVectors.text),
239- .WindowVectors.text)
240218 SECTION_VECTOR (_DebugInterruptVector_text,
241219 .DebugInterruptVector.text,
242220 DEBUG_VECTOR_VADDR,
243- 4 ,
244- .DebugInterruptVector.literal)
221+ .WindowVectors.text)
245222#undef LAST
246223#define LAST .DebugInterruptVector.text
247224#if XCHAL_EXCM_LEVEL >= 2
248225 SECTION_VECTOR (_Level2InterruptVector_text,
249226 .Level2InterruptVector.text,
250227 INTLEVEL2_VECTOR_VADDR,
251- SIZEOF(LAST), LAST)
228+ LAST)
252229# undef LAST
253230# define LAST .Level2InterruptVector.text
254231#endif
255232#if XCHAL_EXCM_LEVEL >= 3
256233 SECTION_VECTOR (_Level3InterruptVector_text,
257234 .Level3InterruptVector.text,
258235 INTLEVEL3_VECTOR_VADDR,
259- SIZEOF(LAST), LAST)
236+ LAST)
260237# undef LAST
261238# define LAST .Level3InterruptVector.text
262239#endif
263240#if XCHAL_EXCM_LEVEL >= 4
264241 SECTION_VECTOR (_Level4InterruptVector_text,
265242 .Level4InterruptVector.text,
266243 INTLEVEL4_VECTOR_VADDR,
267- SIZEOF(LAST), LAST)
244+ LAST)
268245# undef LAST
269246# define LAST .Level4InterruptVector.text
270247#endif
271248#if XCHAL_EXCM_LEVEL >= 5
272249 SECTION_VECTOR (_Level5InterruptVector_text,
273250 .Level5InterruptVector.text,
274251 INTLEVEL5_VECTOR_VADDR,
275- SIZEOF(LAST), LAST)
252+ LAST)
276253# undef LAST
277254# define LAST .Level5InterruptVector.text
278255#endif
279256#if XCHAL_EXCM_LEVEL >= 6
280257 SECTION_VECTOR (_Level6InterruptVector_text,
281258 .Level6InterruptVector.text,
282259 INTLEVEL6_VECTOR_VADDR,
283- SIZEOF(LAST), LAST)
260+ LAST)
284261# undef LAST
285262# define LAST .Level6InterruptVector.text
286263#endif
287- SECTION_VECTOR (_KernelExceptionVector_literal,
288- .KernelExceptionVector.literal,
289- KERNEL_VECTOR_VADDR - 4 ,
290- SIZEOF(LAST), LAST)
291- #undef LAST
292264 SECTION_VECTOR (_KernelExceptionVector_text,
293265 .KernelExceptionVector.text,
294266 KERNEL_VECTOR_VADDR,
295- 4 ,
296- .KernelExceptionVector.literal)
297- SECTION_VECTOR (_UserExceptionVector_literal,
298- .UserExceptionVector.literal,
299- USER_VECTOR_VADDR - 4 ,
300- SIZEOF(.KernelExceptionVector.text),
301- .KernelExceptionVector.text)
267+ LAST)
268+ #undef LAST
302269 SECTION_VECTOR (_UserExceptionVector_text,
303270 .UserExceptionVector.text,
304271 USER_VECTOR_VADDR,
305- 4 ,
306- .UserExceptionVector.literal)
307- SECTION_VECTOR (_DoubleExceptionVector_literal,
308- .DoubleExceptionVector.literal,
309- DOUBLEEXC_VECTOR_VADDR - 20 ,
310- SIZEOF(.UserExceptionVector.text),
311- .UserExceptionVector.text)
272+ .KernelExceptionVector.text)
312273 SECTION_VECTOR (_DoubleExceptionVector_text,
313274 .DoubleExceptionVector.text,
314275 DOUBLEEXC_VECTOR_VADDR,
315- 20 ,
316- .DoubleExceptionVector.literal)
276+ .UserExceptionVector.text)
317277
318278 . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3 ) & ~ 3 ;
319279
@@ -323,7 +283,6 @@ SECTIONS
323283 SECTION_VECTOR (_SecondaryResetVector_text,
324284 .SecondaryResetVector.text,
325285 RESET_VECTOR1_VADDR,
326- SIZEOF(.DoubleExceptionVector.text),
327286 .DoubleExceptionVector.text)
328287
329288 . = LOADADDR(.SecondaryResetVector.text)+SIZEOF(.SecondaryResetVector.text);
@@ -373,5 +332,4 @@ SECTIONS
373332
374333 /* Sections to be discarded */
375334 DISCARDS
376- /DISCARD/ : { *(.exit.literal) }
377335}
0 commit comments