aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorDave Martin <dave.martin@linaro.org>2010-11-29 13:43:28 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-11-30 08:44:26 -0500
commita75e5248c51af1eaeed936be6bd3497b93f09685 (patch)
treee46a3ea86126f77fb3c6539514290dcf874fffd2 /arch/arm/kernel
parent26e5ca93dda9425f8ff78ccb2f9b193328087e45 (diff)
ARM: 6504/1: Thumb-2: Fix long-distance conditional branches in head.S for Thumb-2.
The 32-bit conditional branches in Thumb-2 have a shorter range (+/-512K) than their ARM counterparts (+/-32MB). The linker does not currently generate trampolines to extend the range of these Thumb-2 conditional branches, resulting in link errors when vmlinux is sufficiently large, e.g.: head.o:(.text+0x464): relocation truncated to fit: R_ARM_THM_JUMP19 This patch forces the longer-range, unconditional branch encoding by use of an explicit IT instruction. The resulting branches are triggered on the same conditions as before. Signed-off-by: Dave Martin <dave.martin@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/head.S3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 591c097c89ab..6bd82d25683c 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -85,9 +85,11 @@ ENTRY(stext)
85 mrc p15, 0, r9, c0, c0 @ get processor id 85 mrc p15, 0, r9, c0, c0 @ get processor id
86 bl __lookup_processor_type @ r5=procinfo r9=cpuid 86 bl __lookup_processor_type @ r5=procinfo r9=cpuid
87 movs r10, r5 @ invalid processor (r5=0)? 87 movs r10, r5 @ invalid processor (r5=0)?
88 THUMB( it eq ) @ force fixup-able long branch encoding
88 beq __error_p @ yes, error 'p' 89 beq __error_p @ yes, error 'p'
89 bl __lookup_machine_type @ r5=machinfo 90 bl __lookup_machine_type @ r5=machinfo
90 movs r8, r5 @ invalid machine (r5=0)? 91 movs r8, r5 @ invalid machine (r5=0)?
92 THUMB( it eq ) @ force fixup-able long branch encoding
91 beq __error_a @ yes, error 'a' 93 beq __error_a @ yes, error 'a'
92 bl __vet_atags 94 bl __vet_atags
93#ifdef CONFIG_SMP_ON_UP 95#ifdef CONFIG_SMP_ON_UP
@@ -283,6 +285,7 @@ ENTRY(secondary_startup)
283 bl __lookup_processor_type 285 bl __lookup_processor_type
284 movs r10, r5 @ invalid processor? 286 movs r10, r5 @ invalid processor?
285 moveq r0, #'p' @ yes, error 'p' 287 moveq r0, #'p' @ yes, error 'p'
288 THUMB( it eq ) @ force fixup-able long branch encoding
286 beq __error_p 289 beq __error_p
287 290
288 /* 291 /*