Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a9ad21fe authored by Russell King's avatar Russell King
Browse files

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: default avatarDave Martin <dave.martin@linaro.org>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 53399053
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -21,6 +21,12 @@
#define ARM_CPU_KEEP(x)
#define ARM_CPU_KEEP(x)
#endif
#endif


#if defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)
#define ARM_EXIT_KEEP(x)	x
#else
#define ARM_EXIT_KEEP(x)
#endif

OUTPUT_ARCH(arm)
OUTPUT_ARCH(arm)
ENTRY(stext)
ENTRY(stext)


@@ -43,6 +49,7 @@ SECTIONS
		_sinittext = .;
		_sinittext = .;
			HEAD_TEXT
			HEAD_TEXT
			INIT_TEXT
			INIT_TEXT
			ARM_EXIT_KEEP(EXIT_TEXT)
		_einittext = .;
		_einittext = .;
		ARM_CPU_DISCARD(PROC_INFO)
		ARM_CPU_DISCARD(PROC_INFO)
		__arch_info_begin = .;
		__arch_info_begin = .;
@@ -67,6 +74,7 @@ SECTIONS
#ifndef CONFIG_XIP_KERNEL
#ifndef CONFIG_XIP_KERNEL
		__init_begin = _stext;
		__init_begin = _stext;
		INIT_DATA
		INIT_DATA
		ARM_EXIT_KEEP(EXIT_DATA)
#endif
#endif
	}
	}


@@ -162,6 +170,7 @@ SECTIONS
		. = ALIGN(PAGE_SIZE);
		. = ALIGN(PAGE_SIZE);
		__init_begin = .;
		__init_begin = .;
		INIT_DATA
		INIT_DATA
		ARM_EXIT_KEEP(EXIT_DATA)
		. = ALIGN(PAGE_SIZE);
		. = ALIGN(PAGE_SIZE);
		__init_end = .;
		__init_end = .;
#endif
#endif