ARM: 6504/1: Thumb-2: Fix long-distance conditional branches in head.S for Thumb-2.
authorDave Martin <dave.martin@linaro.org>
Mon, 29 Nov 2010 18:43:28 +0000 (19:43 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Tue, 30 Nov 2010 13:44:26 +0000 (13:44 +0000)
commita75e5248c51af1eaeed936be6bd3497b93f09685
treee46a3ea86126f77fb3c6539514290dcf874fffd2
parent26e5ca93dda9425f8ff78ccb2f9b193328087e45
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>
arch/arm/kernel/head.S