]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
sh: make the linker scripts more generic
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Thu, 4 Jun 2009 10:06:44 +0000 (12:06 +0200)
committerNobuhiro Iwamatsu <iwamatsu@nigauri.org>
Wed, 8 Jul 2009 02:43:15 +0000 (11:43 +0900)
currently we need to sync the linker script enty and TEXT_BASE manualy
and the reloc_dst is based on it

instead provide it now from the ldflags

tested on r2dplus

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
15 files changed:
Makefile
board/mpr2/u-boot.lds
board/ms7720se/u-boot.lds
board/ms7722se/u-boot.lds
board/ms7750se/u-boot.lds
board/renesas/MigoR/u-boot.lds
board/renesas/ap325rxa/u-boot.lds
board/renesas/r2dplus/u-boot.lds
board/renesas/r7780mp/u-boot.lds
board/renesas/rsk7203/u-boot.lds
board/renesas/sh7763rdp/u-boot.lds
board/renesas/sh7785lcr/u-boot.lds
board/renesas/sh7785lcr/u-boot_29bit [deleted file]
board/renesas/sh7785lcr/u-boot_32bit [deleted file]
sh_config.mk

index cf96900b1bca4a127328862f257c14649f2f3577..8d0510366be5ccde965d16b3a8756c48510d52ec 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3534,14 +3534,9 @@ sh7785lcr_config  :   unconfig
        @echo "#define CONFIG_SH7785LCR 1" > $(obj)include/config.h
        @if [ "$(findstring 32bit, $@)" ] ; then \
                echo "#define CONFIG_SH_32BIT 1" >> $(obj)include/config.h ; \
-               cp $(obj)board/renesas/sh7785lcr/u-boot_32bit \
-                       $(obj)board/renesas/sh7785lcr/u-boot.lds ; \
                echo "TEXT_BASE = 0x8ff80000" > \
                        $(obj)board/renesas/sh7785lcr/config.tmp ; \
                  $(XECHO) " ... enable 32-Bit Address Extended Mode" ; \
-       else \
-               cp $(obj)board/renesas/sh7785lcr/u-boot_29bit \
-                       $(obj)board/renesas/sh7785lcr/u-boot.lds ; \
        fi
        @$(MKCONFIG) -a $(call xtract_sh7785lcr,$@) sh sh4 sh7785lcr renesas
 
index deae344a99e2cd119a7761443f973fcbc4d37014..1e55b832f5fc5b444e465489df4534098dd0b124 100644 (file)
@@ -34,16 +34,9 @@ ENTRY(_start)
 SECTIONS
 {
        /*
-          Base address of internal SDRAM is 0x8C000000.
-          U-Boot resides in the last 256 kB of the 64 MB.
-
-          NOTE: This address must match with the definition of
-          TEXT_BASE in config.mk (in this directory).
-
-       */
-       . = 0x8C000000 + (64*1024*1024) - (256*1024);
-
-       PROVIDE (reloc_dst = .);
+        * entry and reloct_dst will be provided via ldflags
+        */
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
index 1f9b79290bbadb21dc977016165b4304dcd59a7e..b006dc82183d6417bdc9e83fc44e94904c5086c9 100644 (file)
@@ -31,18 +31,9 @@ ENTRY(_start)
 SECTIONS
 {
        /*
-          Base address of internal SDRAM is 0x0C000000.
-          Although size of SDRAM can be either 16 or 32 MBytes,
-          we assume 16 MBytes (ie ignore upper half if the full
-          32 MBytes is present).
-
-          NOTE: This address must match with the definition of
-          TEXT_BASE in config.mk (in this directory).
-
-       */
-       . = 0x8C000000 + (64*1024*1024) - (256*1024);
-
-       PROVIDE (reloc_dst = .);
+        * entry and reloct_dst will be provided via ldflags
+        */
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
index 7b0fb67990405a629dfda51acdf30b5e485ac9ae..2ae4f20ef9fd38e03054f773525c7a4d47372d3b 100644 (file)
@@ -28,18 +28,9 @@ ENTRY(_start)
 SECTIONS
 {
        /*
-          Base address of internal SDRAM is 0x0C000000.
-          Although size of SDRAM can be either 16 or 32 MBytes,
-          we assume 16 MBytes (ie ignore upper half if the full
-          32 MBytes is present).
-
-          NOTE: This address must match with the definition of
-          TEXT_BASE in config.mk (in this directory).
-
-       */
-       . = 0x8C000000 + (64*1024*1024) - (256*1024);
-
-       PROVIDE (reloc_dst = .);
+        * entry and reloct_dst will be provided via ldflags
+        */
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
index 7b0fb67990405a629dfda51acdf30b5e485ac9ae..2ae4f20ef9fd38e03054f773525c7a4d47372d3b 100644 (file)
@@ -28,18 +28,9 @@ ENTRY(_start)
 SECTIONS
 {
        /*
-          Base address of internal SDRAM is 0x0C000000.
-          Although size of SDRAM can be either 16 or 32 MBytes,
-          we assume 16 MBytes (ie ignore upper half if the full
-          32 MBytes is present).
-
-          NOTE: This address must match with the definition of
-          TEXT_BASE in config.mk (in this directory).
-
-       */
-       . = 0x8C000000 + (64*1024*1024) - (256*1024);
-
-       PROVIDE (reloc_dst = .);
+        * entry and reloct_dst will be provided via ldflags
+        */
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
index c004b83853f355a0ac907e6b5520cdeb14bc581b..cd40d0737008f855642b5691844d3fef20e3f0fe 100644 (file)
@@ -28,18 +28,9 @@ ENTRY(_start)
 SECTIONS
 {
        /*
-          Base address of internal SDRAM is 0x0C000000.
-          Although size of SDRAM can be either 16 or 32 MBytes,
-          we assume 16 MBytes (ie ignore upper half if the full
-          32 MBytes is present).
-
-          NOTE: This address must match with the definition of
-          TEXT_BASE in config.mk (in this directory).
-
-       */
-       . = 0x8C000000 + (64*1024*1024) - (256*1024);
-
-       PROVIDE (reloc_dst = .);
+        * entry and reloct_dst will be provided via ldflags
+        */
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
index 94bacca37c77f28caa9b12d5720fd7c0e78320d7..cd40d0737008f855642b5691844d3fef20e3f0fe 100644 (file)
@@ -28,18 +28,9 @@ ENTRY(_start)
 SECTIONS
 {
        /*
-          Base address of internal SDRAM is 0x88000000.
-          Although size of SDRAM can be either 16 or 32 MBytes,
-          we assume 16 MBytes (ie ignore upper half if the full
-          32 MBytes is present).
-
-          NOTE: This address must match with the definition of
-          TEXT_BASE in config.mk (in this directory).
-
-       */
-       . = 0x88000000 + (128*1024*1024) - (256*1024);
-
-       PROVIDE (reloc_dst = .);
+        * entry and reloct_dst will be provided via ldflags
+        */
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
index e1c15b0c4b35fdb9bd259c7b17fb7ba5518f6725..86ef50514b337c9911a1af700432a218b9b76d99 100644 (file)
@@ -28,18 +28,9 @@ ENTRY(_start)
 SECTIONS
 {
        /*
-          Base address of internal SDRAM is 0x0C000000.
-          Although size of SDRAM can be either 16 or 32 MBytes,
-          we assume 16 MBytes (ie ignore upper half if the full
-          32 MBytes is present).
-
-          NOTE: This address must match with the definition of
-          TEXT_BASE in config.mk (in this directory).
-
-       */
-       . = 0x0C000000 + (64*1024*1024) - (256*1024);
-
-       PROVIDE (reloc_dst = .);
+        * entry and reloct_dst will be provided via ldflags
+        */
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
index f32d0b86f7676b281620c91a105f9e6957b18387..86ef50514b337c9911a1af700432a218b9b76d99 100644 (file)
@@ -28,18 +28,9 @@ ENTRY(_start)
 SECTIONS
 {
        /*
-          Base address of internal SDRAM is 0x0C000000.
-          Although size of SDRAM can be either 16 or 32 MBytes,
-          we assume 16 MBytes (ie ignore upper half if the full
-          32 MBytes is present).
-
-          NOTE: This address must match with the definition of
-          TEXT_BASE in config.mk (in this directory).
-
-       */
-       . = 0x08000000 + (128*1024*1024) - (256*1024);
-
-       PROVIDE (reloc_dst = .);
+        * entry and reloct_dst will be provided via ldflags
+        */
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
index bd4a550c9e412d8da9a44ccc1759230cd3bfc137..6db5a00913a729ef30885a6107ac5b724e393afb 100644 (file)
@@ -28,15 +28,9 @@ ENTRY(_start)
 SECTIONS
 {
        /*
-        * Base address of internal SDRAM is 0x0C000000.
-        *
-        * NOTE: This address must match with the definition of
-        *TEXT_BASE in config.mk (in this directory).
+        * entry and reloct_dst will be provided via ldflags
         */
-
-       . = 0x0C000000 + (8*1024*1024) - (256*1024);
-
-       PROVIDE (reloc_dst = .);
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
index b1a967d480aa14ec4d78db28c1c371c9769c627d..86ef50514b337c9911a1af700432a218b9b76d99 100644 (file)
@@ -28,18 +28,9 @@ ENTRY(_start)
 SECTIONS
 {
        /*
-          Base address of internal SDRAM is 0x0C000000.
-          Although size of SDRAM can be either 16 or 32 MBytes,
-          we assume 16 MBytes (ie ignore upper half if the full
-          32 MBytes is present).
-
-          NOTE: This address must match with the definition of
-          TEXT_BASE in config.mk (in this directory).
-
-       */
-       . = 0x8C000000 + (64*1024*1024) - (256*1024);
-
-       PROVIDE (reloc_dst = .);
+        * entry and reloct_dst will be provided via ldflags
+        */
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
index 255ab374f9d2c95a3c043ffd6c2b6a55384de51f..48f4ba2d8810a861c5859023c4d6baffc751b3d1 100644 (file)
@@ -28,9 +28,10 @@ ENTRY(_start)
 
 SECTIONS
 {
-       . = 0x88000000 + (128 * 1024 * 1024) - (512 * 1024);
-
-       PROVIDE (reloc_dst = .);
+       /*
+        * entry and reloct_dst will be provided via ldflags
+        */
+       . = .;
 
        PROVIDE (_ftext = .);
        PROVIDE (_fcode = .);
diff --git a/board/renesas/sh7785lcr/u-boot_29bit b/board/renesas/sh7785lcr/u-boot_29bit
deleted file mode 100644 (file)
index 231769f..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyrigth (c) 2007
- * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
- * Copyrigth (c) 2008 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.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
- */
-
-OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
-OUTPUT_ARCH(sh)
-ENTRY(_start)
-
-SECTIONS
-{
-       . = 0x08000000 + (128 * 1024 * 1024) - (512 * 1024);
-
-       PROVIDE (reloc_dst = .);
-
-       PROVIDE (_ftext = .);
-       PROVIDE (_fcode = .);
-       PROVIDE (_start = .);
-
-       .text :
-       {
-               cpu/sh4/start.o         (.text)
-               . = ALIGN(8192);
-               common/env_embedded.o   (.ppcenv)
-               . = ALIGN(8192);
-               common/env_embedded.o   (.ppcenvr)
-               . = ALIGN(8192);
-               *(.text)
-               . = ALIGN(4);
-       } =0xFF
-       PROVIDE (_ecode = .);
-       .rodata :
-       {
-               *(.rodata)
-               . = ALIGN(4);
-       }
-       PROVIDE (_etext = .);
-
-
-       PROVIDE (_fdata = .);
-       .data :
-       {
-               *(.data)
-               . = ALIGN(4);
-       }
-       PROVIDE (_edata = .);
-
-       PROVIDE (_fgot = .);
-       .got :
-       {
-               *(.got)
-               . = ALIGN(4);
-       }
-       PROVIDE (_egot = .);
-
-       PROVIDE (__u_boot_cmd_start = .);
-       .u_boot_cmd :
-       {
-               *(.u_boot_cmd)
-               . = ALIGN(4);
-       }
-       PROVIDE (__u_boot_cmd_end = .);
-
-       PROVIDE (reloc_dst_end = .);
-       /* _reloc_dst_end = .; */
-
-       PROVIDE (bss_start = .);
-       PROVIDE (__bss_start = .);
-       .bss :
-       {
-               *(.bss)
-               . = ALIGN(4);
-       }
-       PROVIDE (bss_end = .);
-
-       PROVIDE (_end = .);
-}
diff --git a/board/renesas/sh7785lcr/u-boot_32bit b/board/renesas/sh7785lcr/u-boot_32bit
deleted file mode 100644 (file)
index 446fb93..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyrigth (c) 2007
- * Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
- * Copyrigth (c) 2008-2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.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
- */
-
-OUTPUT_FORMAT("elf32-sh-linux", "elf32-sh-linux", "elf32-sh-linux")
-OUTPUT_ARCH(sh)
-ENTRY(_start)
-
-SECTIONS
-{
-       . = 0x88000000 + (128 * 1024 * 1024) - (512 * 1024);
-
-       PROVIDE (reloc_dst = .);
-
-       PROVIDE (_ftext = .);
-       PROVIDE (_fcode = .);
-       PROVIDE (_start = .);
-
-       .text :
-       {
-               cpu/sh4/start.o         (.text)
-               . = ALIGN(8192);
-               common/env_embedded.o   (.ppcenv)
-               . = ALIGN(8192);
-               common/env_embedded.o   (.ppcenvr)
-               . = ALIGN(8192);
-               *(.text)
-               . = ALIGN(4);
-       } =0xFF
-       PROVIDE (_ecode = .);
-       .rodata :
-       {
-               *(.rodata)
-               . = ALIGN(4);
-       }
-       PROVIDE (_etext = .);
-
-
-       PROVIDE (_fdata = .);
-       .data :
-       {
-               *(.data)
-               . = ALIGN(4);
-       }
-       PROVIDE (_edata = .);
-
-       PROVIDE (_fgot = .);
-       .got :
-       {
-               *(.got)
-               . = ALIGN(4);
-       }
-       PROVIDE (_egot = .);
-
-       PROVIDE (__u_boot_cmd_start = .);
-       .u_boot_cmd :
-       {
-               *(.u_boot_cmd)
-               . = ALIGN(4);
-       }
-       PROVIDE (__u_boot_cmd_end = .);
-
-       PROVIDE (reloc_dst_end = .);
-       /* _reloc_dst_end = .; */
-
-       PROVIDE (bss_start = .);
-       PROVIDE (__bss_start = .);
-       .bss :
-       {
-               *(.bss)
-               . = ALIGN(4);
-       }
-       PROVIDE (bss_end = .);
-
-       PROVIDE (_end = .);
-}
index 49d50f7ebd99be29cc50183e34a14ae695e69539..c19db53f2e1b22865cc20a41970e0e9b3f1e875d 100644 (file)
@@ -22,3 +22,4 @@
 #
 
 PLATFORM_CPPFLAGS += -DCONFIG_SH -D__SH__
+PLATFORM_LDFLAGS += -e $(TEXT_BASE) --defsym reloc_dst=$(TEXT_BASE)