]> asedeno.scripts.mit.edu Git - linux.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)
commit27c524d1743047258f9a6a2ad813f54d35c1f8e8
tree843f31412ad7100e2bee0fa4f6ecc90a77fd7b7a
parentb9120c016da8a98f7663df505bfaf2944cded18f
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