linux/arch/arm/boot/compressed
Ard Biesheuvel 06a4b6d009 ARM: 8677/1: boot/compressed: fix decompressor header layout for v7-M
As reported by Patrice, the header layout of the decompressor is
incorrect when building for v7-M. In this case, the __nop macro
resolves to 'mov r0, r0', which is emitted as a narrow encoding,
resulting in the header data fields to end up at lower offsets than
required.

Given the variety of targets we need to support with the same code,
the startup sequence is a bit of a jumble, and uses instructions
and macros whose encoding widths cannot be specified (badr), or only
exist in a narrow encoding (bx)

So force the use of a wide encoding in __nop, and replace the start
sequence with a simple jump to the label marking the start of code,
preceded by a Thumb2 mode switch if required (using explicit wide
encodings where appropriate). The label itself can be moved to the
start of code [where it belongs] due to the larger range of branch
instructions as compared to adr instructions.

Reported-by: Patrice CHOTARD <patrice.chotard@st.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2017-06-05 10:29:40 +01:00
..
.gitignore ARM: 8542/1: decompressor: merge piggy.*.S and simplify Makefile 2016-02-22 16:56:31 +00:00
atags_to_fdt.c ARM: 8025/1: Get rid of meminfo 2014-06-01 01:17:12 +01:00
big-endian.S
debug.S ARM: 7737/1: fix kernel decompressor compilation error with CONFIG_DEBUG_SEMIHOSTING 2013-06-05 23:32:24 +01:00
decompress.c ARM: 8654/1: decompressor: add strlen prototype 2017-02-28 11:06:18 +00:00
efi-header.S ARM: 8677/1: boot/compressed: fix decompressor header layout for v7-M 2017-06-05 10:29:40 +01:00
head-sa1100.S ARM: 7743/1: compressed/head.S: work around new binutils warning 2013-06-05 23:32:27 +01:00
head-sharpsl.S
head-xscale.S ARM: remove ixp23xx and ixp2000 platforms 2012-04-06 08:26:18 -05:00
head.S ARM: 8677/1: boot/compressed: fix decompressor header layout for v7-M 2017-06-05 10:29:40 +01:00
libfdt_env.h libfdt: add fdt type definitions 2015-04-29 17:17:17 -05:00
ll_char_wr.S
Makefile Merge branches 'amba', 'fixes', 'misc' and 'tauros2' into for-next 2016-03-04 23:36:02 +00:00
misc.c stackprotector: Introduce CONFIG_CC_STACKPROTECTOR_STRONG 2013-12-20 09:38:40 +01:00
piggy.S ARM: 8542/1: decompressor: merge piggy.*.S and simplify Makefile 2016-02-22 16:56:31 +00:00
string.c ARM: boot: Add an implementation of strnlen for libfdt 2016-02-11 19:43:47 -06:00
vmlinux.lds.S ARM: add UEFI stub support 2015-12-14 10:38:21 +01:00