ARM: Keep exit text/data around for SMP_ON_UP

When SMP_ON_UP is used and the spinlocks are inlined, we end up with
inline spinlocks in the exit code, with references from the SMP
alternatives section to the exit sections. This causes link time
errors. Avoid this by placing the exit sections in the init-discarded
region.

Cc: <stable@kernel.org>
Tested-by: Dave Martin <dave.martin@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

+9
+9
arch/arm/kernel/vmlinux.lds.S
··· 21 #define ARM_CPU_KEEP(x) 22 #endif 23 24 OUTPUT_ARCH(arm) 25 ENTRY(stext) 26 ··· 49 _sinittext = .; 50 HEAD_TEXT 51 INIT_TEXT 52 _einittext = .; 53 ARM_CPU_DISCARD(PROC_INFO) 54 __arch_info_begin = .; ··· 74 #ifndef CONFIG_XIP_KERNEL 75 __init_begin = _stext; 76 INIT_DATA 77 #endif 78 } 79 ··· 170 . = ALIGN(PAGE_SIZE); 171 __init_begin = .; 172 INIT_DATA 173 . = ALIGN(PAGE_SIZE); 174 __init_end = .; 175 #endif
··· 21 #define ARM_CPU_KEEP(x) 22 #endif 23 24 + #if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK) 25 + #define ARM_EXIT_KEEP(x) x 26 + #else 27 + #define ARM_EXIT_KEEP(x) 28 + #endif 29 + 30 OUTPUT_ARCH(arm) 31 ENTRY(stext) 32 ··· 43 _sinittext = .; 44 HEAD_TEXT 45 INIT_TEXT 46 + ARM_EXIT_KEEP(EXIT_TEXT) 47 _einittext = .; 48 ARM_CPU_DISCARD(PROC_INFO) 49 __arch_info_begin = .; ··· 67 #ifndef CONFIG_XIP_KERNEL 68 __init_begin = _stext; 69 INIT_DATA 70 + ARM_EXIT_KEEP(EXIT_DATA) 71 #endif 72 } 73 ··· 162 . = ALIGN(PAGE_SIZE); 163 __init_begin = .; 164 INIT_DATA 165 + ARM_EXIT_KEEP(EXIT_DATA) 166 . = ALIGN(PAGE_SIZE); 167 __init_end = .; 168 #endif