]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: zImage: make sure not to relocate on top of the relocation code
authorNicolas Pitre <nicolas.pitre@linaro.org>
Wed, 27 Apr 2011 20:15:11 +0000 (16:15 -0400)
committerNicolas Pitre <nico@fluxnic.net>
Sat, 7 May 2011 04:07:53 +0000 (00:07 -0400)
commitb3c082d3948af317a8223ac72536b9f370b198ac
tree9953511f394eabaab7331e895f707fd1de1a6271
parented15ee09a0d2b564d3f07f9f26ac6afeaac6fcc3
ARM: zImage: make sure not to relocate on top of the relocation code

If the zImage load address is slightly below the relocation address,
there is a risk for the copied data to overwrite the copy loop or
cache flush code that the relocation process requires.  Always
bump the relocation address by the size of that code to avoid this
issue.

Noticed by Tony Lindgren <tony@atomide.com>.

While at it, let's start the copy from the restart symbol which makes
the above code size computation possible by the assembler directly
(same sections), given that we don't need to preserve the code before
that point anyway. And therefore we don't need to carry the _start
pointer in r5 anymore.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Tested-by: Tony Lindgren <tony@atomide.com>
arch/arm/boot/compressed/head.S