diff options
author | Paul Mundt <lethal@linux-sh.org> | 2009-05-09 11:25:08 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-05-09 11:25:08 -0400 |
commit | 7b022d07a0fd2ce02d4456b732c674ff1d16f5ce (patch) | |
tree | 02bd8fccea476085e5184f413d4210695f83c88b /arch/sh | |
parent | dce97c8cb2ad365fa87dc6924d99528c21c63912 (diff) |
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: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/Makefile | 8 | ||||
-rw-r--r-- | arch/sh/boot/compressed/Makefile_32 | 3 | ||||
-rw-r--r-- | arch/sh/boot/compressed/Makefile_64 | 4 | ||||
-rw-r--r-- | arch/sh/kernel/vmlinux.lds.S | 6 |
4 files changed, 11 insertions, 10 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 68348e700288..b941dc9b20f4 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -100,13 +100,17 @@ LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ | |||
100 | endif | 100 | endif |
101 | 101 | ||
102 | ifdef CONFIG_CPU_LITTLE_ENDIAN | 102 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
103 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' | 103 | ld-bfd := elf32-$(UTS_MACHINE)-linux |
104 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd) | ||
104 | LDFLAGS += -EL | 105 | LDFLAGS += -EL |
105 | else | 106 | else |
106 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' | 107 | ld-bfd := elf32-$(UTS_MACHINE)big-linux |
108 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' --oformat $(ld-bfd) | ||
107 | LDFLAGS += -EB | 109 | LDFLAGS += -EB |
108 | endif | 110 | endif |
109 | 111 | ||
112 | export ld-bfd | ||
113 | |||
110 | head-y := arch/sh/kernel/init_task.o | 114 | head-y := arch/sh/kernel/init_task.o |
111 | head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o | 115 | head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o |
112 | head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o | 116 | head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o |
diff --git a/arch/sh/boot/compressed/Makefile_32 b/arch/sh/boot/compressed/Makefile_32 index b96a055b053e..249255729d7c 100644 --- a/arch/sh/boot/compressed/Makefile_32 +++ b/arch/sh/boot/compressed/Makefile_32 | |||
@@ -28,7 +28,8 @@ ORIG_CFLAGS := $(KBUILD_CFLAGS) | |||
28 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) | 28 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
29 | endif | 29 | endif |
30 | 30 | ||
31 | LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds | 31 | LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \ |
32 | -T $(obj)/../../kernel/vmlinux.lds | ||
32 | 33 | ||
33 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE | 34 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE |
34 | $(call if_changed,ld) | 35 | $(call if_changed,ld) |
diff --git a/arch/sh/boot/compressed/Makefile_64 b/arch/sh/boot/compressed/Makefile_64 index 658d4f915556..541a529d066c 100644 --- a/arch/sh/boot/compressed/Makefile_64 +++ b/arch/sh/boot/compressed/Makefile_64 | |||
@@ -24,8 +24,8 @@ OBJECTS := $(obj)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o \ | |||
24 | ZIMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ | 24 | ZIMAGE_OFFSET := $(shell /bin/bash -c 'printf "0x%08x" \ |
25 | $$[$(CONFIG_PAGE_OFFSET)+0x400000+0x10000]') | 25 | $$[$(CONFIG_PAGE_OFFSET)+0x400000+0x10000]') |
26 | 26 | ||
27 | LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \ | 27 | LDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(ZIMAGE_OFFSET) -e startup \ |
28 | -T $(obj)/../../kernel/vmlinux.lds | 28 | -T $(obj)/../../kernel/vmlinux.lds |
29 | 29 | ||
30 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE | 30 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE |
31 | $(call if_changed,ld) | 31 | $(call if_changed,ld) |
diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S index 8d97f52ce322..1a2c8db5cb2a 100644 --- a/arch/sh/kernel/vmlinux.lds.S +++ b/arch/sh/kernel/vmlinux.lds.S | |||
@@ -6,12 +6,8 @@ | |||
6 | #define LOAD_OFFSET CONFIG_PAGE_OFFSET | 6 | #define LOAD_OFFSET CONFIG_PAGE_OFFSET |
7 | OUTPUT_ARCH(sh:sh5) | 7 | OUTPUT_ARCH(sh:sh5) |
8 | #else | 8 | #else |
9 | #define LOAD_OFFSET 0 | ||
9 | OUTPUT_ARCH(sh) | 10 | OUTPUT_ARCH(sh) |
10 | #ifdef CONFIG_CPU_LITTLE_ENDIAN | ||
11 | OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux") | ||
12 | #else | ||
13 | OUTPUT_FORMAT("elf32-shbig-linux", "elf32-shbig-linux", "elf32-shbig-linux") | ||
14 | #endif | ||
15 | #endif | 11 | #endif |
16 | 12 | ||
17 | #include <asm/thread_info.h> | 13 | #include <asm/thread_info.h> |