提交 7b022d07 编写于 作者: P Paul Mundt

sh: Tidy up the ldscript output format specifier.

Tie this in to the Makefile directly, where we already know what we are
running on. This tidies up the linker script a bit, and is prep work for
unifying the arch/sh/boot/compressed linker scripts.
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 dce97c8c
...@@ -100,13 +100,17 @@ LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ ...@@ -100,13 +100,17 @@ LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
endif endif
ifdef CONFIG_CPU_LITTLE_ENDIAN ifdef CONFIG_CPU_LITTLE_ENDIAN
LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' ld-bfd := elf32-$(UTS_MACHINE)-linux
LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd)
LDFLAGS += -EL LDFLAGS += -EL
else else
LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' ld-bfd := elf32-$(UTS_MACHINE)big-linux
LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' --oformat $(ld-bfd)
LDFLAGS += -EB LDFLAGS += -EB
endif endif
export ld-bfd
head-y := arch/sh/kernel/init_task.o head-y := arch/sh/kernel/init_task.o
head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o
head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o
......
...@@ -28,7 +28,8 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS) ...@@ -28,7 +28,8 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS)
KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
endif endif
LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
-T $(obj)/../../kernel/vmlinux.lds
$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
$(call if_changed,ld) $(call if_changed,ld)
......
...@@ -24,8 +24,8 @@ OBJECTS := $(obj)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o \ ...@@ -24,8 +24,8 @@ OBJECTS := $(obj)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o \
ZIMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ ZIMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \
$$[$(CONFIG_PAGE_OFFSET)+0x400000+0x10000]') $$[$(CONFIG_PAGE_OFFSET)+0x400000+0x10000]')
LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \ LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(ZIMAGE_OFFSET) -e startup \
-T $(obj)/../../kernel/vmlinux.lds -T $(obj)/../../kernel/vmlinux.lds
$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE
$(call if_changed,ld) $(call if_changed,ld)
......
...@@ -6,12 +6,8 @@ ...@@ -6,12 +6,8 @@
#define LOAD_OFFSET CONFIG_PAGE_OFFSET #define LOAD_OFFSET CONFIG_PAGE_OFFSET
OUTPUT_ARCH(sh:sh5) OUTPUT_ARCH(sh:sh5)
#else #else
#define LOAD_OFFSET 0
OUTPUT_ARCH(sh) OUTPUT_ARCH(sh)
#ifdef CONFIG_CPU_LITTLE_ENDIAN
OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
#else
OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux")
#endif
#endif #endif
#include <asm/thread_info.h> #include <asm/thread_info.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册