From 6c5216e2a01cbc7b3428ce3e5d5a783407c7440b Mon Sep 17 00:00:00 2001 From: Kai Germaschewski Date: Tue, 17 Sep 2002 08:37:55 -0500 Subject: [PATCH] kbuild: Fix up CRIS vmlinux.lds.S Untested, but at least it should show how to adapt the cris arch. --- arch/cris/Makefile | 28 +++++++--------------------- arch/cris/{cris.ld => vmlinux.lds.S} | 6 ++++-- 2 files changed, 11 insertions(+), 23 deletions(-) rename arch/cris/{cris.ld => vmlinux.lds.S} (95%) diff --git a/arch/cris/Makefile b/arch/cris/Makefile index 1b5c9af76fdd..b0ec2ec5a71f 100644 --- a/arch/cris/Makefile +++ b/arch/cris/Makefile @@ -10,28 +10,12 @@ # License. See the file "COPYING" in the main directory of this archive # for more details. -LD_SCRIPT=$(TOPDIR)/arch/cris/cris.ld - # A bug in ld prevents us from having a (constant-value) symbol in a -# "ORIGIN =" or "LENGTH =" expression. We fix that by generating a -# linker file with the symbolic part of those expressions evaluated. -# Unfortunately, there is trouble making vmlinux depend on anything we -# generate here, so we *always* regenerate the final linker script and -# replace the LD macro to get what we want. Thankfully(?) vmlinux is -# always rebuilt (due to calling make recursively and not knowing if -# anything was rebuilt). -# The shell script to build in some kind of dependency is really not -# necessary for reasons of speed. It's there because always -# regenerating stuff (even for incremental linking of subsystems!) is -# even more nauseating. -LD = if [ ! -e $(LD_SCRIPT).tmp -o $(LD_SCRIPT) -nt $(LD_SCRIPT).tmp ]; then \ - sed -e s/@CONFIG_ETRAX_DRAM_VIRTUAL_BASE@/0x$(CONFIG_ETRAX_DRAM_VIRTUAL_BASE)/ \ - -e s/@CONFIG_ETRAX_DRAM_SIZE_M@/$(CONFIG_ETRAX_DRAM_SIZE)/ \ - < $(LD_SCRIPT) > $(LD_SCRIPT).tmp; \ - else true; \ - fi && $(CROSS_COMPILE)ld -mcrislinux - -LDFLAGS_vmlinux = -T $(LD_SCRIPT).tmp +# "ORIGIN =" or "LENGTH =" expression. + +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 @@ -63,6 +47,8 @@ LIBS := $(TOPDIR)/arch/cris/lib/lib.a $(LIBS) $(TOPDIR)/arch/cris/lib/lib.a $(LI MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot +vmlinux: arch/$(ARCH)/vmlinux.lds.s + vmlinux.bin: vmlinux $(OBJCOPY) $(OBJCOPYFLAGS) vmlinux vmlinux.bin diff --git a/arch/cris/cris.ld b/arch/cris/vmlinux.lds.S similarity index 95% rename from arch/cris/cris.ld rename to arch/cris/vmlinux.lds.S index edf1fa3f112c..74ac779474eb 100644 --- a/arch/cris/cris.ld +++ b/arch/cris/vmlinux.lds.S @@ -8,10 +8,12 @@ * the kernel has booted. */ +#include + jiffies = jiffies_64; SECTIONS { - . = @CONFIG_ETRAX_DRAM_VIRTUAL_BASE@; + . = 0x ## CONFIG_ETRAX_DRAM_VIRTUAL_BASE; dram_start = .; ibr_start = .; . = . + 0x4000; /* see head.S and pages reserved at the start */ @@ -99,5 +101,5 @@ SECTIONS *(.exitcall.exit) } - dram_end = dram_start + @CONFIG_ETRAX_DRAM_SIZE_M@*1024*1024; + dram_end = dram_start + CONFIG_ETRAX_DRAM_SIZE*1024*1024; } -- 2.39.5