]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Handle most LDSCRIPT setting centrally
authorScott Wood <scottwood@freescale.com>
Wed, 6 Apr 2011 13:31:37 +0000 (13:31 +0000)
committerWolfgang Denk <wd@denx.de>
Fri, 29 Apr 2011 22:59:47 +0000 (00:59 +0200)
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 <scottwood@freescale.com>
Tested-by: Graeme Russ <graeme.russ@gmail.com>
30 files changed:
arch/arm/config.mk
arch/nios2/config.mk
arch/powerpc/config.mk
arch/sh/config.mk
arch/x86/config.mk
board/actux1/config.mk
board/actux2/config.mk
board/actux3/config.mk
board/altera/nios2-generic/config.mk
board/amcc/acadia/config.mk
board/amcc/bamboo/config.mk
board/amcc/canyonlands/config.mk
board/amcc/kilauea/config.mk
board/amcc/sequoia/config.mk
board/atmel/atstk1000/config.mk
board/avnet/fx12mm/config.mk [deleted file]
board/avnet/v5fx30teval/config.mk [deleted file]
board/cm5200/u-boot.lds [deleted file]
board/cogent/config.mk
board/earthlcd/favr-32-ezkit/config.mk
board/freescale/mx31ads/config.mk
board/hymod/config.mk
board/munices/u-boot.lds [deleted file]
board/samsung/smdk6400/config.mk
board/sc3/u-boot.lds [deleted file]
board/trab/config.mk
board/xilinx/ml507/config.mk [deleted file]
board/xilinx/ppc405-generic/config.mk [deleted file]
board/xilinx/ppc440-generic/config.mk [deleted file]
config.mk

index fcc26a2f3006023ad74ce77c51614b9f076c00e6..ec1b4209518cdef8bd4a1bf979e363be7f708d3c 100644 (file)
@@ -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
index d241a96e8e81024f9e8641af5c3a97c26c8016d5..e58ea24d2cb1b5aef061c1fa6a293a6609763794 100644 (file)
@@ -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
index e682071bd73f477f957d9863627cf03c7150839b..a30715459de952a543cd85d6fe21eac74260ac0c 100644 (file)
@@ -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
index af57307574f3c260612a62fda351d21f7e037748..07ff8b9348e5beece2d86d4f74dc9a96b868684b 100644 (file)
@@ -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
index e9452012a66aa8bb246939202a43c7b7b848e0ed..ee23c9f87d29fd20e6b6c12ac06a9da12d02790d 100644 (file)
@@ -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
index 88634f7fe2b278a763231008fa18e0edfe0827a7..9cb838b7380ce75e86c3934bef50cd965ddc8be2 100644 (file)
@@ -2,5 +2,3 @@ CONFIG_SYS_TEXT_BASE = 0x00e00000
 
 # include NPE ethernet driver
 BOARDLIBS = arch/arm/cpu/ixp/npe/libnpe.o
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
index 88634f7fe2b278a763231008fa18e0edfe0827a7..9cb838b7380ce75e86c3934bef50cd965ddc8be2 100644 (file)
@@ -2,5 +2,3 @@ CONFIG_SYS_TEXT_BASE = 0x00e00000
 
 # include NPE ethernet driver
 BOARDLIBS = arch/arm/cpu/ixp/npe/libnpe.o
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
index 88634f7fe2b278a763231008fa18e0edfe0827a7..9cb838b7380ce75e86c3934bef50cd965ddc8be2 100644 (file)
@@ -2,5 +2,3 @@ CONFIG_SYS_TEXT_BASE = 0x00e00000
 
 # include NPE ethernet driver
 BOARDLIBS = arch/arm/cpu/ixp/npe/libnpe.o
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
index 95e75af034d4f726a2ac735e239e416d804563ce..00c16fc4c5a7b5eee8c8675574d94768c28c0812 100644 (file)
@@ -30,5 +30,3 @@ PLATFORM_CPPFLAGS += -I$(TOPDIR)/board/$(VENDOR)/include
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
 endif
-
-LDSCRIPT := $(SRCTREE)/board/$(VENDOR)/$(BOARD)/u-boot.lds
index 2f2787f1128901ff220ae290d52b2c5ba1bbbf8c..bfc0945704042c3df2c2cc749f3bd20f44140d73 100644 (file)
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
 endif
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_U_BOOT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-endif
index 7ca16a06639bac7ff883831738959e59ae5677cd..24f74e121330cfdd3f5ba4ff559a3a4a6bfff792 100644 (file)
@@ -30,10 +30,3 @@ endif
 ifeq ($(dbcr),1)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff0000
 endif
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_U_BOOT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-endif
index abf2a268083c07b90571abdc79de506f785f72ad..d693a26b8112c235d28b93e05f4dbdbe2049088a 100644 (file)
@@ -33,10 +33,3 @@ endif
 ifeq ($(dbcr),1)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff0000
 endif
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_U_BOOT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-endif
index 4ae3ea92657df0bb12a37b6e1d04b0c380e4a2f2..003b8c3b81988dee0b0ae7d78031102c61541ee5 100644 (file)
 ifeq ($(debug),1)
 PLATFORM_CPPFLAGS += -DDEBUG
 endif
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_U_BOOT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-endif
index 73efe727d2c794f79aed867029771a597ba790d2..e0bf07115ffe819f6bd539e7a5be19b7ac9854af 100644 (file)
@@ -33,10 +33,3 @@ endif
 ifeq ($(dbcr),1)
 PLATFORM_CPPFLAGS += -DCONFIG_SYS_INIT_DBCR=0x8cff0000
 endif
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-else ifdef CONFIG_NAND_U_BOOT
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-endif
index 8c03b77f7b55ffea430be6651d2f712a148c87c2..284f7ff32e6f86a933c8a34e8e37b833cbac5e74 100644 (file)
@@ -1,4 +1,3 @@
 PLATFORM_RELFLAGS      += -ffunction-sections -fdata-sections
 PLATFORM_LDFLAGS       += --gc-sections
 CONFIG_SYS_TEXT_BASE           = 0x00000000
-LDSCRIPT               = $(src)board/atmel/atstk1000/u-boot.lds
diff --git a/board/avnet/fx12mm/config.mk b/board/avnet/fx12mm/config.mk
deleted file mode 100644 (file)
index 78dde62..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# (C) Copyright 2008
-# Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@uam.es
-# Work supported by Qtechnology http://www.qtec.com
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-#
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-endif
diff --git a/board/avnet/v5fx30teval/config.mk b/board/avnet/v5fx30teval/config.mk
deleted file mode 100644 (file)
index 78dde62..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# (C) Copyright 2008
-# Ricardo Ribalda-Universidad Autonoma de Madrid-ricardo.ribalda@uam.es
-# Work supported by Qtechnology http://www.qtec.com
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-#
-
-ifdef CONFIG_SYS_LDSCRIPT
-# need to strip off double quotes
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-endif
diff --git a/board/cm5200/u-boot.lds b/board/cm5200/u-boot.lds
deleted file mode 100644 (file)
index cf73b11..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * (C) Copyright 2003-2007
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    arch/powerpc/cpu/mpc5xxx/start.o   (.text)
-    *(.text)
-    *(.got1)
-    . = ALIGN(16);
-    *(.eh_frame)
-    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  . = .;
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss (NOLOAD)       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-   . = ALIGN(4);
-  }
-  __bss_end__ = . ;
-  PROVIDE (end = .);
-}
index 78730db490fbb609436425b7a4a71f9b7fbe04e7..12e2e7c2a725e8e0086c60b2942a143ddab1715c 100644 (file)
@@ -26,5 +26,3 @@
 #
 
 PLATFORM_CPPFLAGS += -I$(TOPDIR)
-
-LDSCRIPT := $(SRCTREE)/board/cogent/u-boot.lds
index f8bc88dbe3d622fc992a6e35a9d2699ced4d1f3f..284f7ff32e6f86a933c8a34e8e37b833cbac5e74 100644 (file)
@@ -1,4 +1,3 @@
 PLATFORM_RELFLAGS      += -ffunction-sections -fdata-sections
 PLATFORM_LDFLAGS       += --gc-sections
 CONFIG_SYS_TEXT_BASE           = 0x00000000
-LDSCRIPT               = $(src)board/earthlcd/favr-32-ezkit/u-boot.lds
index 2303f30bd7e681fd54d357a8a7fef9740e12f70d..0131edfbe9a651f510cb781d7c6cd3d673f8d4cc 100644 (file)
@@ -1,3 +1 @@
 CONFIG_SYS_TEXT_BASE = 0x87f00000
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
index ae766bc857cde9afc81adb9faafff78beac52b36..ea64004863f5f52672c189648905264cb73c0c7b 100644 (file)
@@ -28,5 +28,3 @@
 PLATFORM_CPPFLAGS += -I$(TOPDIR)
 
 OBJCFLAGS = --remove-section=.ppcenv
-
-LDSCRIPT := $(SRCTREE)/board/hymod/u-boot.lds
diff --git a/board/munices/u-boot.lds b/board/munices/u-boot.lds
deleted file mode 100644 (file)
index 99576bf..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * (C) Copyright 2007
- * Heiko Schocher, DENX Software Engineering, hs@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    arch/powerpc/cpu/mpc5xxx/start.o   (.text)
-    *(.text)
-    *(.got1)
-    . = ALIGN(16);
-    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x0FFF) & 0xFFFFF000;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    *(.got)
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >> 2;
-  __fixup_entries = (. - _FIXUP_TABLE_) >> 2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(4096);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(4096);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss (NOLOAD)       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-   . = ALIGN(4);
-  }
-  __bss_end__ = . ;
-  PROVIDE (end = .);
-}
index 90cbcf25d4554b31447574d2a648ee06ce7f51c9..6f04c2f568cc81b687f549a6a6c4d67cb61cfe91 100644 (file)
@@ -28,5 +28,3 @@ CONFIG_SYS_TEXT_BASE = $(RAM_TEXT)
 else
 CONFIG_SYS_TEXT_BASE = 0
 endif
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot-nand.lds
diff --git a/board/sc3/u-boot.lds b/board/sc3/u-boot.lds
deleted file mode 100644 (file)
index 4db46ca..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * (C) Copyright 2000
- * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-OUTPUT_ARCH(powerpc)
-/* Do we need any of these for elf?
-   __DYNAMIC = 0;    */
-SECTIONS
-{
-  .resetvec 0xFFFFFFFC :
-  {
-    *(.resetvec)
-  } = 0xffff
-
-  /* Read-only sections, merged into text segment: */
-  . = + SIZEOF_HEADERS;
-  .interp : { *(.interp) }
-  .hash          : { *(.hash)          }
-  .dynsym        : { *(.dynsym)                }
-  .dynstr        : { *(.dynstr)                }
-  .rel.text      : { *(.rel.text)              }
-  .rela.text     : { *(.rela.text)     }
-  .rel.data      : { *(.rel.data)              }
-  .rela.data     : { *(.rela.data)     }
-  .rel.rodata    : { *(.rel.rodata)    }
-  .rela.rodata   : { *(.rela.rodata)   }
-  .rel.got       : { *(.rel.got)               }
-  .rela.got      : { *(.rela.got)              }
-  .rel.ctors     : { *(.rel.ctors)     }
-  .rela.ctors    : { *(.rela.ctors)    }
-  .rel.dtors     : { *(.rel.dtors)     }
-  .rela.dtors    : { *(.rela.dtors)    }
-  .rel.bss       : { *(.rel.bss)               }
-  .rela.bss      : { *(.rela.bss)              }
-  .rel.plt       : { *(.rel.plt)               }
-  .rela.plt      : { *(.rela.plt)              }
-  .init          : { *(.init)  }
-  .plt : { *(.plt) }
-  .text      :
-  {
-    /* WARNING - the following is hand-optimized to fit within */
-    /* the sector layout of our flash chips!   XXX FIXME XXX   */
-
-    arch/powerpc/cpu/ppc4xx/start.o    (.text)
-    board/sc3/init.o   (.text)
-    arch/powerpc/cpu/ppc4xx/kgdb.o     (.text)
-    arch/powerpc/cpu/ppc4xx/traps.o    (.text)
-    arch/powerpc/cpu/ppc4xx/interrupts.o       (.text)
-    arch/powerpc/cpu/ppc4xx/4xx_uart.o (.text)
-    arch/powerpc/cpu/ppc4xx/cpu_init.o (.text)
-    arch/powerpc/cpu/ppc4xx/speed.o    (.text)
-    common/dlmalloc.o  (.text)
-    lib/crc32.o                (.text)
-    arch/powerpc/lib/extable.o (.text)
-    lib/zlib.o         (.text)
-
-/*    . = env_offset;*/
-/*    common/env_embedded.o(.text)*/
-
-    *(.text)
-    *(.got1)
-  }
-  _etext = .;
-  PROVIDE (etext = .);
-  .rodata    :
-  {
-    *(.eh_frame)
-    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
-  }
-  .fini      : { *(.fini)    } =0
-  .ctors     : { *(.ctors)   }
-  .dtors     : { *(.dtors)   }
-
-  /* Read-write section, merged into data segment: */
-  . = (. + 0x00FF) & 0xFFFFFF00;
-  _erotext = .;
-  PROVIDE (erotext = .);
-  .reloc   :
-  {
-    _GOT2_TABLE_ = .;
-    *(.got2)
-    *(.got)
-    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4);
-    _FIXUP_TABLE_ = .;
-    *(.fixup)
-  }
-  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1;
-  __fixup_entries = (. - _FIXUP_TABLE_)>>2;
-
-  .data    :
-  {
-    *(.data)
-    *(.data1)
-    *(.sdata)
-    *(.sdata2)
-    *(.dynamic)
-    CONSTRUCTORS
-  }
-  _edata  =  .;
-  PROVIDE (edata = .);
-
-  . = .;
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
-
-  . = ALIGN(256);
-  __init_begin = .;
-  .text.init : { *(.text.init) }
-  .data.init : { *(.data.init) }
-  . = ALIGN(256);
-  __init_end = .;
-
-  __bss_start = .;
-  .bss (NOLOAD)       :
-  {
-   *(.sbss) *(.scommon)
-   *(.dynbss)
-   *(.bss)
-   *(COMMON)
-   . = ALIGN(4);
-  }
-  __bss_end__ = . ;
-  PROVIDE (end = .);
-}
index a349b8c1ddfa821ad46d335540c0e301e485ba27..367f0b72a32ddc5ecaa199fed6cf9707a0d7a432 100644 (file)
@@ -24,5 +24,3 @@ sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 ifndef CONFIG_SYS_TEXT_BASE
 CONFIG_SYS_TEXT_BASE = 0x0DF40000
 endif
-
-LDSCRIPT := $(SRCTREE)/board/$(BOARDDIR)/u-boot.lds
diff --git a/board/xilinx/ml507/config.mk b/board/xilinx/ml507/config.mk
deleted file mode 100644 (file)
index 4df1d9c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# need to strip off double quotes
-ifneq ($(CONFIG_SYS_LDSCRIPT),)
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-endif
diff --git a/board/xilinx/ppc405-generic/config.mk b/board/xilinx/ppc405-generic/config.mk
deleted file mode 100644 (file)
index 4df1d9c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# need to strip off double quotes
-ifneq ($(CONFIG_SYS_LDSCRIPT),)
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-endif
diff --git a/board/xilinx/ppc440-generic/config.mk b/board/xilinx/ppc440-generic/config.mk
deleted file mode 100644 (file)
index 4df1d9c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-# need to strip off double quotes
-ifneq ($(CONFIG_SYS_LDSCRIPT),)
-LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
-endif
index fa46ff1a5138adcfc0d4bf068acb10420e06a29e..7ce554ecfec32beb8479c353c40b2b31dfdcf7f3 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -153,14 +153,37 @@ endif
 RELFLAGS= $(PLATFORM_RELFLAGS)
 DBGFLAGS= -g # -DDEBUG
 OPTFLAGS= -Os #-fomit-frame-pointer
+
+# If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
+# that (or fail if absent).  Otherwise, search for a linker script in a
+# standard location.
+
 ifndef LDSCRIPT
-#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
-ifeq ($(CONFIG_NAND_U_BOOT),y)
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
-else
-LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
+       #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
+       ifdef CONFIG_SYS_LDSCRIPT
+               # need to strip off double quotes
+               LDSCRIPT := $(subst ",,$(CONFIG_SYS_LDSCRIPT))
+       endif
 endif
+
+ifndef LDSCRIPT
+       ifeq ($(CONFIG_NAND_U_BOOT),y)
+               LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-nand.lds
+               ifeq ($(wildcard $(LDSCRIPT)),)
+                       LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-nand.lds
+               endif
+       endif
+       ifeq ($(wildcard $(LDSCRIPT)),)
+               LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds
+       endif
+       ifeq ($(wildcard $(LDSCRIPT)),)
+               LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot.lds
+       endif
+       ifeq ($(wildcard $(LDSCRIPT)),)
+$(error could not find linker script)
+       endif
 endif
+
 OBJCFLAGS += --gap-fill=0xff
 
 gccincdir := $(shell $(CC) -print-file-name=include)