OpenCloudOS-Kernel/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
Makefile Merge branches 'amba', 'fixes', 'misc' and 'tauros2' into for-next 2016-03-04 23:36:02 +00:00
atags_to_fdt.c ARM: 8025/1: Get rid of meminfo 2014-06-01 01:17:12 +01:00
big-endian.S Linux-2.6.12-rc2 2005-04-16 15:20:36 -07:00
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 Remove obsolete #include <linux/config.h> 2006-06-30 19:25:36 +02:00
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 [ARM] Remove LOADREGS macro 2006-06-25 11:23:45 +01: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