From: Paul Mundt <lethal@linux-sh.org>
Date: Tue, 20 Nov 2007 06:38:11 +0000 (+0900)
Subject: sh: Fix up the _stext references for SH-5.
X-Git-Tag: firefly_0821_release~23662^2~117
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b4db3aec8351c78df77bbd95f1951a4dd0246853;p=firefly-linux-kernel-4.4.55.git

sh: Fix up the _stext references for SH-5.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
---

diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index 4da3bc696b3d..15161f1851a5 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -74,15 +74,21 @@ OBJCOPYFLAGS	:= -O binary -R .note -R .note.gnu.build-id -R .comment -R .stab -R
 # never be used by anyone. Use a board-specific defconfig that has a
 # reasonable chance of being current instead.
 #
-KBUILD_DEFCONFIG := r7780rp_defconfig
+KBUILD_DEFCONFIG	:= r7780rp_defconfig
 
-KBUILD_IMAGE	:= arch/sh/boot/zImage
+KBUILD_IMAGE		:= arch/sh/boot/zImage
 
 #
 # Choosing incompatible machines durings configuration will result in
 # error messages during linking.
 #
-LDFLAGS_vmlinux     += -e _stext
+ifdef CONFIG_SUPERH32
+LDFLAGS_vmlinux	+= -e _stext
+else
+LDFLAGS_vmlinux	+= --defsym phys_stext=_stext-$(CONFIG_CACHED_MEMORY_OFFSET) \
+		   --defsym phys_stext_shmedia=phys_stext+1 \
+		   -e phys_stext_shmedia
+endif
 
 ifdef CONFIG_CPU_LITTLE_ENDIAN
 LDFLAGS_vmlinux		+= --defsym 'jiffies=jiffies_64'