]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: Use the entry point from the ELF file header
authorMaciej W. Rozycki <macro@mips.com>
Thu, 22 Mar 2018 16:30:41 +0000 (16:30 +0000)
committerJames Hogan <jhogan@kernel.org>
Thu, 22 Mar 2018 22:30:58 +0000 (22:30 +0000)
commit9a64a4e4d6da52cc59b53f1d2bea779deb7d49be
tree843f31412ad7100e2bee0fa4f6ecc90a77fd7b7a
parenta265207447ad48b0bd79f655315eafba41cd5877
MIPS: Use the entry point from the ELF file header

In order to fetch the correct entry point with the ISA bit included, for
use by non-ELF boot loaders, parse the output of `objdump -f' for the
start address recorded in the kernel executable itself, rather than
using `nm' to get the value of the `kernel_entry' symbol.

Sign-extend the address retrieved if 32-bit, so that execution is
correctly started on 64-bit processors as well.  The tool always prints
the entry point using either 8 or 16 hexadecimal digits, matching the
address width (aka class) of the ELF file, even in the presence of
leading zeros.

Signed-off-by: Maciej W. Rozycki <macro@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/18912/
Signed-off-by: James Hogan <jhogan@kernel.org>
arch/mips/Makefile