Commit 26976a3d authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Handle vmlinux linkscript from common code

Now that all archs use the same way to generate the link script, we can
handle it from the common top-level Makefile instead of the individual
arch/*/Makefile's.
parent 761de242
...@@ -297,7 +297,9 @@ define rule_link_vmlinux ...@@ -297,7 +297,9 @@ define rule_link_vmlinux
$(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map $(NM) vmlinux | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
endef endef
vmlinux: $(vmlinux-objs) FORCE LDFLAGS_vmlinux += -T arch/$(ARCH)/vmlinux.lds.s
vmlinux: $(vmlinux-objs) arch/$(ARCH)/vmlinux.lds.s FORCE
$(call if_changed_rule,link_vmlinux) $(call if_changed_rule,link_vmlinux)
# The actual objects are generated when descending, # The actual objects are generated when descending,
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
NM := $(NM) -B NM := $(NM) -B
LDFLAGS_vmlinux = -static -T arch/alpha/vmlinux.lds.s -N #-relax LDFLAGS_vmlinux = -static -N #-relax
CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8 CFLAGS := $(CFLAGS) -pipe -mno-fp-regs -ffixed-8
# Determine if we can use the BWX instructions with GAS. # Determine if we can use the BWX instructions with GAS.
...@@ -126,8 +126,6 @@ archclean: ...@@ -126,8 +126,6 @@ archclean:
archmrproper: archmrproper:
rm -f include/asm-alpha/asm_offsets.h rm -f include/asm-alpha/asm_offsets.h
vmlinux: arch/alpha/vmlinux.lds.s
bootpfile: bootpfile:
@$(MAKEBOOT) bootpfile @$(MAKEBOOT) bootpfile
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# Copyright (C) 1995-2001 by Russell King # Copyright (C) 1995-2001 by Russell King
LDFLAGS_vmlinux :=-p -X -T arch/arm/vmlinux.lds.s LDFLAGS_vmlinux :=-p -X
OBJCOPYFLAGS :=-O binary -R .note -R .comment -S OBJCOPYFLAGS :=-O binary -R .note -R .comment -S
GZFLAGS :=-9 GZFLAGS :=-9
#CFLAGS +=-pipe #CFLAGS +=-pipe
...@@ -215,8 +215,6 @@ maketools: include/asm-arm/.arch include/asm-arm/.proc \ ...@@ -215,8 +215,6 @@ maketools: include/asm-arm/.arch include/asm-arm/.proc \
include/asm-arm/constants.h include/linux/version.h FORCE include/asm-arm/constants.h include/linux/version.h FORCE
@$(MAKETOOLS) @$(MAKETOOLS)
vmlinux: arch/arm/vmlinux.lds.s
bzImage zImage zinstall Image bootpImage install: vmlinux bzImage zImage zinstall Image bootpImage install: vmlinux
@$(MAKEBOOT) $@ @$(MAKEBOOT) $@
......
...@@ -15,8 +15,6 @@ ...@@ -15,8 +15,6 @@
LD = $(CROSS_COMPILE)ld -mcrislinux LD = $(CROSS_COMPILE)ld -mcrislinux
LDFLAGS_vmlinux = -T arch/$(ARCH)/vmlinux.lds.s
# objcopy is used to make binary images from the resulting linked file # objcopy is used to make binary images from the resulting linked file
OBJCOPYFLAGS := -O binary -R .note -R .comment -S OBJCOPYFLAGS := -O binary -R .note -R .comment -S
...@@ -47,8 +45,6 @@ LIBS := $(TOPDIR)/arch/cris/lib/lib.a $(LIBS) $(TOPDIR)/arch/cris/lib/lib.a $(LI ...@@ -47,8 +45,6 @@ LIBS := $(TOPDIR)/arch/cris/lib/lib.a $(LIBS) $(TOPDIR)/arch/cris/lib/lib.a $(LI
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/$(ARCH)/vmlinux.lds.s
vmlinux.bin: vmlinux vmlinux.bin: vmlinux
$(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
LDFLAGS := -m elf_i386 LDFLAGS := -m elf_i386
OBJCOPYFLAGS := -O binary -R .note -R .comment -S OBJCOPYFLAGS := -O binary -R .note -R .comment -S
LDFLAGS_vmlinux := -T arch/i386/vmlinux.lds.s -e stext LDFLAGS_vmlinux := -e stext
CFLAGS += -pipe CFLAGS += -pipe
...@@ -104,8 +104,6 @@ endif ...@@ -104,8 +104,6 @@ endif
MAKEBOOT = +$(MAKE) -C arch/$(ARCH)/boot MAKEBOOT = +$(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/i386/vmlinux.lds.s
.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \ .PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
clean archclean archmrproper clean archclean archmrproper
......
...@@ -14,7 +14,7 @@ AWK := awk ...@@ -14,7 +14,7 @@ AWK := awk
export AWK export AWK
OBJCOPYFLAGS := --strip-all OBJCOPYFLAGS := --strip-all
LDFLAGS_vmlinux := -static -T arch/$(ARCH)/vmlinux.lds.s LDFLAGS_vmlinux := -static
AFLAGS_KERNEL := -mconstant-gp AFLAGS_KERNEL := -mconstant-gp
EXTRA = EXTRA =
...@@ -94,8 +94,6 @@ LIBS := $(TOPDIR)/arch/$(ARCH)/lib/lib.a $(LIBS) \ ...@@ -94,8 +94,6 @@ LIBS := $(TOPDIR)/arch/$(ARCH)/lib/lib.a $(LIBS) \
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/$(ARCH)/vmlinux.lds.s
compressed: vmlinux compressed: vmlinux
$(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux-tmp $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux-tmp
gzip vmlinux-tmp gzip vmlinux-tmp
......
...@@ -24,10 +24,8 @@ ifneq ($(COMPILE_ARCH),$(ARCH)) ...@@ -24,10 +24,8 @@ ifneq ($(COMPILE_ARCH),$(ARCH))
CROSS_COMPILE = m68k-linux- CROSS_COMPILE = m68k-linux-
endif endif
ifndef CONFIG_SUN3 ifdef CONFIG_SUN3
LDFLAGS_vmlinux = -T $(TOPDIR)/arch/m68k/vmlinux.lds.s LDFLAGS_vmlinux = -N
else
LDFLAGS_vmlinux = -T $(TOPDIR)/arch/m68k/vmlinux.lds.s -N
endif endif
# without -fno-strength-reduce the 53c7xx.c driver fails ;-( # without -fno-strength-reduce the 53c7xx.c driver fails ;-(
...@@ -134,8 +132,6 @@ CORE_FILES := $(CORE_FILES) arch/m68k/math-emu/mathemu.o ...@@ -134,8 +132,6 @@ CORE_FILES := $(CORE_FILES) arch/m68k/math-emu/mathemu.o
SUBDIRS := $(SUBDIRS) arch/m68k/math-emu SUBDIRS := $(SUBDIRS) arch/m68k/math-emu
endif endif
vmlinux: arch/$(ARCH)/vmlinux.lds.s
lilo: vmlinux lilo: vmlinux
if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi if [ -f $(INSTALL_PATH)/vmlinux ]; then mv -f $(INSTALL_PATH)/vmlinux $(INSTALL_PATH)/vmlinux.old; fi
if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi if [ -f $(INSTALL_PATH)/System.map ]; then mv -f $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi
......
...@@ -266,9 +266,6 @@ endif ...@@ -266,9 +266,6 @@ endif
# error messages during linking. Select a default linkscript if # error messages during linking. Select a default linkscript if
# none has been choosen above. # none has been choosen above.
# #
vmlinux: arch/$(ARCH)/vmlinux.lds.s
LDFLAGS_vmlinux += -T arch/$(ARCH)/vmlinux.lds.s
AFLAGS_vmlinux.lds.o := -DLOADADDR=$(LOADADDR) AFLAGS_vmlinux.lds.o := -DLOADADDR=$(LOADADDR)
......
...@@ -117,7 +117,6 @@ endif ...@@ -117,7 +117,6 @@ endif
# #
ifdef CONFIG_BOOT_ELF32 ifdef CONFIG_BOOT_ELF32
CFLAGS += -Wa,-32 CFLAGS += -Wa,-32
LDFLAGS_vmlinux += -T arch/mips64/vmlinux.lds.s
endif endif
# #
# The 64-bit ELF tools are pretty broken so at this time we generate 64-bit # The 64-bit ELF tools are pretty broken so at this time we generate 64-bit
...@@ -125,7 +124,6 @@ endif ...@@ -125,7 +124,6 @@ endif
# #
ifdef CONFIG_BOOT_ELF64 ifdef CONFIG_BOOT_ELF64
CFLAGS += -Wa,-32 CFLAGS += -Wa,-32
LDFLAGS_vmlinux += -T arch/mips64/vmlinux.lds.s
#AS += -64 #AS += -64
#LDFLAGS += -m elf64bmip #LDFLAGS += -m elf64bmip
#LDFLAGS_vmlinux += -T arch/mips64/ld.script.elf64 #LDFLAGS_vmlinux += -T arch/mips64/ld.script.elf64
...@@ -147,8 +145,6 @@ else ...@@ -147,8 +145,6 @@ else
64bit-bfd = elf64-bigmips 64bit-bfd = elf64-bigmips
endif endif
vmlinux: arch/mips64/vmlinux.lds.s
AFLAGS_vmlinux.lds.o := -imacros $(srctree)/include/asm-mips64/sn/mapped_kernel.h AFLAGS_vmlinux.lds.o := -imacros $(srctree)/include/asm-mips64/sn/mapped_kernel.h
ifdef CONFIG_MAPPED_KERNEL ifdef CONFIG_MAPPED_KERNEL
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align FINAL_LD=$(CROSS_COMPILE)ld --warn-common --warn-section-align
OBJCOPY_FLAGS =-O binary -R .note -R .comment -S OBJCOPY_FLAGS =-O binary -R .note -R .comment -S
LDFLAGS_vmlinux =-T arch/parisc/vmlinux.lds.s
CFLAGS_PIPE := -pipe CFLAGS_PIPE := -pipe
CFLAGS_NSR := -fno-strength-reduce CFLAGS_NSR := -fno-strength-reduce
...@@ -55,8 +54,6 @@ SUBDIRS := $(SUBDIRS) arch/parisc/kdb ...@@ -55,8 +54,6 @@ SUBDIRS := $(SUBDIRS) arch/parisc/kdb
DRIVERS := $(DRIVERS) arch/parisc/kdb/kdb.o DRIVERS := $(DRIVERS) arch/parisc/kdb/kdb.o
endif endif
vmlinux: arch/$(ARCH)/vmlinux.lds.s
palo: vmlinux palo: vmlinux
export TOPDIR=`pwd`; export CONFIG_STI_CONSOLE=$(CONFIG_STI_CONSOLE); \ export TOPDIR=`pwd`; export CONFIG_STI_CONSOLE=$(CONFIG_STI_CONSOLE); \
unset STRIP LDFLAGS CPP CPPFLAGS AFLAGS CFLAGS CC LD; cd ../palo && make lifimage unset STRIP LDFLAGS CPP CPPFLAGS AFLAGS CFLAGS CC LD; cd ../palo && make lifimage
......
...@@ -21,7 +21,7 @@ else ...@@ -21,7 +21,7 @@ else
KERNELLOAD =0xc0000000 KERNELLOAD =0xc0000000
endif endif
LDFLAGS_vmlinux = -T arch/ppc/vmlinux.lds.s -Ttext $(KERNELLOAD) -Bstatic LDFLAGS_vmlinux = -Ttext $(KERNELLOAD) -Bstatic
CPPFLAGS := $(CPPFLAGS) -I$(TOPDIR)/arch/$(ARCH) CPPFLAGS := $(CPPFLAGS) -I$(TOPDIR)/arch/$(ARCH)
AFLAGS := $(AFLAGS) -I$(TOPDIR)/arch/$(ARCH) AFLAGS := $(AFLAGS) -I$(TOPDIR)/arch/$(ARCH)
CFLAGS := $(CFLAGS) -I$(TOPDIR)/arch/$(ARCH) -fsigned-char \ CFLAGS := $(CFLAGS) -I$(TOPDIR)/arch/$(ARCH) -fsigned-char \
...@@ -103,8 +103,6 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd pImage vmlinux.sm ...@@ -103,8 +103,6 @@ BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd pImage vmlinux.sm
# All the instructions talk about "make bzImage". # All the instructions talk about "make bzImage".
bzImage: zImage bzImage: zImage
vmlinux: arch/$(ARCH)/vmlinux.lds.s
$(BOOT_TARGETS): vmlinux $(BOOT_TARGETS): vmlinux
@$(MAKEBOOT) $@ @$(MAKEBOOT) $@
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
KERNELLOAD =0xc000000000000000 KERNELLOAD =0xc000000000000000
LDFLAGS := -m elf64ppc LDFLAGS := -m elf64ppc
LDFLAGS_vmlinux = -T arch/ppc64/vmlinux.lds.s -Bstatic \ LDFLAGS_vmlinux = -Bstatic \
-e $(KERNELLOAD) -Ttext $(KERNELLOAD) -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
CFLAGS := $(CFLAGS) -msoft-float -pipe \ CFLAGS := $(CFLAGS) -msoft-float -pipe \
-Wno-uninitialized -mminimal-toc -mtraceback=full \ -Wno-uninitialized -mminimal-toc -mtraceback=full \
...@@ -46,8 +46,6 @@ ifdef CONFIG_PPC_ISERIES ...@@ -46,8 +46,6 @@ ifdef CONFIG_PPC_ISERIES
BOOT_TARGETS = vmlinux.sminitrd vmlinux.initrd vmlinux.sm BOOT_TARGETS = vmlinux.sminitrd vmlinux.initrd vmlinux.sm
endif endif
vmlinux: arch/$(ARCH)/vmlinux.lds.s
$(BOOT_TARGETS): vmlinux $(BOOT_TARGETS): vmlinux
@$(MAKEBOOT) $@ @$(MAKEBOOT) $@
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
LDFLAGS := -m elf_s390 LDFLAGS := -m elf_s390
OBJCOPYFLAGS := -O binary OBJCOPYFLAGS := -O binary
LDFLAGS_vmlinux := -T arch/$(ARCH)/vmlinux.lds.s -e start LDFLAGS_vmlinux := -e start
CFLAGS_PIPE := -pipe CFLAGS_PIPE := -pipe
CFLAGS_NSR := -fno-strength-reduce CFLAGS_NSR := -fno-strength-reduce
...@@ -41,8 +41,6 @@ listing: vmlinux ...@@ -41,8 +41,6 @@ listing: vmlinux
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/$(ARCH)/vmlinux.lds.s
image: vmlinux image: vmlinux
@$(MAKEBOOT) image @$(MAKEBOOT) image
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
LDFLAGS := -m elf64_s390 LDFLAGS := -m elf64_s390
OBJCOPYFLAGS := -O binary OBJCOPYFLAGS := -O binary
LDFLAGS_vmlinux := -T arch/$(ARCH)/vmlinux.lds.s -e start LDFLAGS_vmlinux := -e start
MODFLAGS += -fpic MODFLAGS += -fpic
CFLAGS_PIPE := -pipe CFLAGS_PIPE := -pipe
...@@ -36,8 +36,6 @@ listing: vmlinux ...@@ -36,8 +36,6 @@ listing: vmlinux
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/$(ARCH)/vmlinux.lds.s
image: vmlinux image: vmlinux
@$(MAKEBOOT) image @$(MAKEBOOT) image
......
...@@ -42,11 +42,9 @@ endif ...@@ -42,11 +42,9 @@ endif
# #
# Choosing incompatible machines durings configuration will result in # Choosing incompatible machines durings configuration will result in
# error messages during linking. Select a default linkscript if # error messages during linking.
# none has been choosen above.
# #
LINKSCRIPT = arch/sh/vmlinux.lds.s LDFLAGS_vmlinux += -e _stext
LDFLAGS_vmlinux += -T $(word 1,$(LINKSCRIPT)) -e _stext
ifdef LOADADDR ifdef LOADADDR
LDFLAGS_vmlinux += -Ttext $(word 1,$(LOADADDR)) LDFLAGS_vmlinux += -Ttext $(word 1,$(LOADADDR))
...@@ -70,8 +68,6 @@ SUBDIRS += arch/sh/stboards ...@@ -70,8 +68,6 @@ SUBDIRS += arch/sh/stboards
CORE_FILES += arch/sh/stboards/stboards.o CORE_FILES += arch/sh/stboards/stboards.o
endif endif
vmlinux: arch/sh/vmlinux.lds.s
AFLAGS_vmlinux.lds.o := -traditional AFLAGS_vmlinux.lds.o := -traditional
zImage: vmlinux zImage: vmlinux
......
...@@ -31,7 +31,6 @@ CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7 ...@@ -31,7 +31,6 @@ CFLAGS := $(CFLAGS) -m32 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
endif endif
#LDFLAGS_vmlinux = -N -Ttext 0xf0004000 #LDFLAGS_vmlinux = -N -Ttext 0xf0004000
LDFLAGS_vmlinux = -T arch/sparc/vmlinux.lds.s
HEAD := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o HEAD := arch/sparc/kernel/head.o arch/sparc/kernel/init_task.o
...@@ -52,8 +51,6 @@ CORE_FILES += arch/sparc/boot/btfix.o ...@@ -52,8 +51,6 @@ CORE_FILES += arch/sparc/boot/btfix.o
export CORE_FILES_NO_BTFIX export CORE_FILES_NO_BTFIX
export INIT export INIT
vmlinux: arch/$(ARCH)/vmlinux.lds.s
archclean: archclean:
rm -f $(TOPDIR)/vmlinux.aout rm -f $(TOPDIR)/vmlinux.aout
-$(MAKE) -C arch/sparc/boot clean -$(MAKE) -C arch/sparc/boot clean
......
...@@ -53,8 +53,6 @@ ifeq ($(CONFIG_MCOUNT),y) ...@@ -53,8 +53,6 @@ ifeq ($(CONFIG_MCOUNT),y)
CFLAGS := $(CFLAGS) -pg CFLAGS := $(CFLAGS) -pg
endif endif
LDFLAGS_vmlinux = -T arch/sparc64/vmlinux.lds.s
HEAD := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o HEAD := arch/sparc64/kernel/head.o arch/sparc64/kernel/init_task.o
SUBDIRS += arch/sparc64/kernel arch/sparc64/lib arch/sparc64/mm \ SUBDIRS += arch/sparc64/kernel arch/sparc64/lib arch/sparc64/mm \
...@@ -77,8 +75,6 @@ CORE_FILES += arch/sparc64/math-emu/math-emu.o ...@@ -77,8 +75,6 @@ CORE_FILES += arch/sparc64/math-emu/math-emu.o
LIBS := $(TOPDIR)/lib/lib.a $(LIBS) $(TOPDIR)/arch/sparc64/prom/promlib.a \ LIBS := $(TOPDIR)/lib/lib.a $(LIBS) $(TOPDIR)/arch/sparc64/prom/promlib.a \
$(TOPDIR)/arch/sparc64/lib/lib.a $(TOPDIR)/arch/sparc64/lib/lib.a
vmlinux: arch/$(ARCH)/vmlinux.lds.s
vmlinux.aout: vmlinux vmlinux.aout: vmlinux
$(ELFTOAOUT) -o $(TOPDIR)/vmlinux.aout $(TOPDIR)/vmlinux $(ELFTOAOUT) -o $(TOPDIR)/vmlinux.aout $(TOPDIR)/vmlinux
......
...@@ -35,7 +35,7 @@ export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP ...@@ -35,7 +35,7 @@ export IA32_CC IA32_LD IA32_AS IA32_OBJCOPY IA32_CPP
LD=$(CROSS_COMPILE)ld -m elf_x86_64 LD=$(CROSS_COMPILE)ld -m elf_x86_64
OBJCOPYFLAGS := -O binary -R .note -R .comment -S OBJCOPYFLAGS := -O binary -R .note -R .comment -S
LDFLAGS_vmlinux := -T arch/x86_64/vmlinux.lds.s -e stext LDFLAGS_vmlinux := -e stext
CFLAGS += -mno-red-zone CFLAGS += -mno-red-zone
CFLAGS += -mcmodel=kernel CFLAGS += -mcmodel=kernel
...@@ -66,8 +66,6 @@ CORE_FILES += $(core-y) ...@@ -66,8 +66,6 @@ CORE_FILES += $(core-y)
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
vmlinux: arch/x86_64/vmlinux.lds.s
.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \ .PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
clean archclean archmrproper clean archclean archmrproper
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment