From 83b7e2a7f2f9cf7651e623c75aa9a27ad6488fb3 Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Wed, 6 Apr 2011 13:31:37 +0000 Subject: Handle most LDSCRIPT setting centrally Currently, some linker scripts are found by common code in config.mk. Some are found using CONFIG_SYS_LDSCRIPT, but the code for that is sometimes in arch config.mk and sometimes in board config.mk. Some are found using an arch-specific rule for looking in CPUDIR, etc. Further, the powerpc config.mk rule relied on CONFIG_NAND_SPL when it really wanted CONFIG_NAND_U_BOOT -- which covered up the fact that not all NAND_U_BOOT builds actually wanted CPUDIR/u-boot-nand.lds. Replace all of this -- except for a handful of boards that are actually selecting a linker script in a unique way -- with centralized ldscript finding. If board code specifies LDSCRIPT, that will be used. Otherwise, if CONFIG_SYS_LDSCRIPT is specified, that will be used. If neither of these are specified, then the central config.mk will check for the existence of the following, in order: $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds (only if CONFIG_NAND_U_BOOT) $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds (only if CONFIG_NAND_U_BOOT) $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds $(TOPDIR)/$(CPUDIR)/u-boot.lds Some boards (sc3, cm5200, munices) provided their own u-boot.lds that were dead code, because they were overridden by a CPUDIR u-boot.lds under the old powerpc rules. These boards' own u-boot.lds have bitrotted and no longer work -- these lds files have been removed. Signed-off-by: Scott Wood Tested-by: Graeme Russ --- arch/arm/config.mk | 1 - arch/nios2/config.mk | 2 -- arch/powerpc/config.mk | 11 ----------- arch/sh/config.mk | 6 ------ arch/x86/config.mk | 1 - 5 files changed, 21 deletions(-) (limited to 'arch') diff --git a/arch/arm/config.mk b/arch/arm/config.mk index fcc26a2f30..ec1b420951 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -61,7 +61,6 @@ ifeq (,$(findstring arch/arm/lib/eabi_compat.o,$(PLATFORM_LIBS))) PLATFORM_LIBS += $(OBJTREE)/arch/arm/lib/eabi_compat.o endif endif -LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds # needed for relocation ifndef CONFIG_NAND_SPL diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk index d241a96e8e..e58ea24d2c 100644 --- a/arch/nios2/config.mk +++ b/arch/nios2/config.mk @@ -29,7 +29,5 @@ STANDALONE_LOAD_ADDR ?= 0x02000000 PLATFORM_CPPFLAGS += -DCONFIG_NIOS2 -D__NIOS2__ PLATFORM_CPPFLAGS += -G0 -LDSCRIPT ?= $(SRCTREE)/$(CPUDIR)/u-boot.lds - LDFLAGS_FINAL += --gc-sections PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk index e682071bd7..a30715459d 100644 --- a/arch/powerpc/config.mk +++ b/arch/powerpc/config.mk @@ -29,17 +29,6 @@ PLATFORM_RELFLAGS += -fpic -mrelocatable -ffunction-sections -fdata-sections PLATFORM_CPPFLAGS += -DCONFIG_PPC -D__powerpc__ PLATFORM_LDFLAGS += -n -ifdef CONFIG_SYS_LDSCRIPT -# need to strip off double quotes -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -else ifdef CONFIG_NAND_SPL -LDSCRIPT := $(SRCTREE)/$(CONFIG_BOARDDIR)/u-boot-nand.lds -else -ifneq ($(wildcard $(SRCTREE)/arch/powerpc/cpu/$(CPU)/u-boot.lds),) -LDSCRIPT := $(SRCTREE)/arch/powerpc/cpu/$(CPU)/u-boot.lds -endif -endif - # # When cross-compiling on NetBSD, we have to define __PPC__ or else we # will pick up a va_list declaration that is incompatible with the diff --git a/arch/sh/config.mk b/arch/sh/config.mk index af57307574..07ff8b9348 100644 --- a/arch/sh/config.mk +++ b/arch/sh/config.mk @@ -31,9 +31,3 @@ endif PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__ PLATFORM_LDFLAGS += -e $(CONFIG_SYS_TEXT_BASE) --defsym reloc_dst=$(CONFIG_SYS_TEXT_BASE) LDFLAGS_FINAL = --gc-sections - -ifdef CONFIG_SYS_LDSCRIPT -LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT)) -else -LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds -endif diff --git a/arch/x86/config.mk b/arch/x86/config.mk index e9452012a6..ee23c9f87d 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk @@ -39,4 +39,3 @@ PLATFORM_RELFLAGS += -ffunction-sections -fvisibility=hidden PLATFORM_LDFLAGS += --emit-relocs -Bsymbolic -Bsymbolic-functions LDFLAGS_FINAL += --gc-sections -pie -LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds -- cgit v1.2.1