[PATCH] MIPS: Use objdump -f to find kernel entry point

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When using nm to find the address of the kernel_entry symbol, the
microMIPS ISA bit is not set for microMIPS kernels. This means that the
entry address reported for the kernel is one that is treated as MIPS32
code, which causes problems if it is placed into an image such as a
uImage or FIT image from which the bootloader will read the entry
address & branch to it as non-microMIPS code.

Fix this by instead using the objdump tool to determine the kernel entry
address instead. We already pass $(OBJDUMP) around the kernel makefiles,
and it reports the entry address with the microMIPS ISA bit intact.

Signed-off-by: Paul Burton <paul.burton@xxxxxxxxxx>
---
 arch/mips/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index efd7a9d..9bf611d 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -232,8 +232,9 @@ include arch/mips/Kbuild.platforms
 ifdef CONFIG_PHYSICAL_START
 load-y					= $(CONFIG_PHYSICAL_START)
 endif
-entry-y				= 0x$(shell $(NM) vmlinux 2>/dev/null \
-					| grep "\bkernel_entry\b" | cut -f1 -d \ )
+entry-y				= $(shell $(OBJDUMP) -f vmlinux 2>/dev/null \
+					| grep "^start address " \
+					| cut -f3 -d \ )
 
 cflags-y			+= -I$(srctree)/arch/mips/include/asm/mach-generic
 drivers-$(CONFIG_PCI)		+= arch/mips/pci/
-- 
2.9.3





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux