OSDN Git Service

powerpc: Fix COFF zImage booting on old powermacs
authorPaul Mackerras <paulus@ozlabs.org>
Mon, 26 Nov 2018 22:01:54 +0000 (09:01 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 26 Nov 2018 23:55:11 +0000 (10:55 +1100)
commit5564597d51c8ff5b88d95c76255e18b13b760879
tree136f51b19c5722ed61476f724bf69d5912d56ad1
parentb2fed34a628df6118b5d4e13f49a33e15f704fa9
powerpc: Fix COFF zImage booting on old powermacs

Commit 6975a783d7b4 ("powerpc/boot: Allow building the zImage wrapper
as a relocatable ET_DYN", 2011-04-12) changed the procedure descriptor
at the start of crt0.S to have a hard-coded start address of 0x500000
rather than a reference to _zimage_start, presumably because having
a reference to a symbol introduced a relocation which is awkward to
handle in a position-independent executable.  Unfortunately, what is
at 0x500000 in the COFF image is not the first instruction, but the
procedure descriptor itself, that is, a word containing 0x500000,
which is not a valid instruction.  Hence, booting a COFF zImage
results in a "DEFAULT CATCH!, code=FFF00700" message from Open
Firmware.

This fixes the problem by (a) putting the procedure descriptor in the
data section and (b) adding a branch to _zimage_start as the first
instruction in the program.

Fixes: 6975a783d7b4 ("powerpc/boot: Allow building the zImage wrapper as a relocatable ET_DYN")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/boot/crt0.S