Determine correct load address for ARC images
Quantenna modified the linker script for vmlinux. CONFIG_LINUX_LINK_BASE
is no longer where the image starts. Instead, the linker script defines
the symbol _img_start_addr as the load address.
Quantenna sets the entry point to the same address as the load address.
This works fine because the image starts with a jump instruction that
jumps to res_service. We can just bypass this jump by setting the entry
point straight to res_service.
diff --git a/arch/arc/boot/Makefile b/arch/arc/boot/Makefile
index f94cf15..711070c 100644
--- a/arch/arc/boot/Makefile
+++ b/arch/arc/boot/Makefile
@@ -9,7 +9,10 @@
LINUX_START_TEXT = $$(readelf -h vmlinux | \
grep "Entry point address" | grep -o 0x.*)
-UIMAGE_LOADADDR = $(CONFIG_LINUX_LINK_BASE)
+LINUX_START_IMAGE = $$(objdump -t vmlinux | \
+ grep _img_start_addr | grep -o -Ee '^[[:alnum:]]{8}')
+
+UIMAGE_LOADADDR = $(LINUX_START_IMAGE)
UIMAGE_ENTRYADDR = $(LINUX_START_TEXT)
suffix-y := bin