Skip to contentSkip to conversation

RFC: create u-boot-common.lds

PATCH Superseded Troy Kisky 5 participants 28 messages Feb 5, 2012 – Feb 12, 2012

Subsystems (9)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Troy Kisky

author
#0 lore raw

PATCH 1/2 RFC: create u-boot-common.lds

This makes adding linker defined tables easier
as far fewer lds files will need to be touched.

Series based on Stefano's u-boot-imx
Close inspection of

board/mousse/u-boot.lds.ram
arch/blackfin/cpu/u-boot.lds

is warranted.

./MAKEALL -a arm
Boards compiled: 216
Boards with warnings or errors: 71

---
 arch/arm/cpu/arm1136/u-boot.lds                  |    7 +------
 arch/arm/cpu/arm1176/u-boot.lds                  |    5 +----
 arch/arm/cpu/arm720t/u-boot.lds                  |    7 +------
 arch/arm/cpu/arm920t/ep93xx/u-boot.lds           |    5 +----
 arch/arm/cpu/arm920t/u-boot.lds                  |    7 +------
 arch/arm/cpu/arm925t/u-boot.lds                  |    7 +------
 arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds       |    5 +----
 arch/arm/cpu/arm926ejs/u-boot.lds                |    7 +------
 arch/arm/cpu/arm946es/u-boot.lds                 |    7 +------
 arch/arm/cpu/arm_intcm/u-boot.lds                |    7 +------
 arch/arm/cpu/armv7/u-boot.lds                    |    8 ++------
 arch/arm/cpu/ixp/u-boot.lds                      |    7 +------
 arch/arm/cpu/lh7a40x/u-boot.lds                  |    7 +------
 arch/arm/cpu/pxa/u-boot.lds                      |    7 +------
 arch/arm/cpu/s3c44b0/u-boot.lds                  |    7 +------
 arch/arm/cpu/sa1100/u-boot.lds                   |    7 +------
 arch/avr32/cpu/u-boot.lds                        |    8 +-------
 arch/blackfin/cpu/u-boot.lds                     |   15 ++++++---------
 arch/nds32/cpu/n1213/u-boot.lds                  |    5 +----
 arch/nios2/cpu/u-boot.lds                        |    8 ++------
 arch/powerpc/cpu/74xx_7xx/u-boot.lds             |   11 +----------
 arch/powerpc/cpu/mpc512x/u-boot.lds              |   11 +----------
 arch/powerpc/cpu/mpc5xx/u-boot.lds               |   11 +----------
 arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds |   11 +----------
 arch/powerpc/cpu/mpc5xxx/u-boot.lds              |   11 +----------
 arch/powerpc/cpu/mpc8220/u-boot.lds              |   11 +----------
 arch/powerpc/cpu/mpc824x/u-boot.lds              |   11 +----------
 arch/powerpc/cpu/mpc8260/u-boot.lds              |   11 +----------
 arch/powerpc/cpu/mpc83xx/u-boot.lds              |   11 +----------
 arch/powerpc/cpu/mpc85xx/u-boot-nand.lds         |   10 +---------
 arch/powerpc/cpu/mpc85xx/u-boot.lds              |   10 +---------
 arch/powerpc/cpu/mpc86xx/u-boot.lds              |   10 +---------
 arch/powerpc/cpu/ppc4xx/u-boot.lds               |   10 +---------
 arch/sandbox/cpu/u-boot.lds                      |    4 +---
 arch/sh/cpu/sh2/u-boot.lds                       |    9 ++-------
 arch/sh/cpu/sh3/u-boot.lds                       |   10 +++-------
 arch/sh/cpu/sh4/u-boot.lds                       |    9 ++-------
 arch/x86/cpu/u-boot.lds                          |    6 +-----
 board/BuS/EB+MCF-EV123/u-boot.lds                |   10 +---------
 board/LEOX/elpt860/u-boot.lds                    |   10 +---------
 board/LEOX/elpt860/u-boot.lds.debug              |    4 +---
 board/RPXClassic/u-boot.lds                      |   11 +----------
 board/RPXClassic/u-boot.lds.debug                |    9 +--------
 board/RPXlite/u-boot.lds                         |   11 +----------
 board/RPXlite/u-boot.lds.debug                   |    9 +--------
 board/RPXlite_dw/u-boot.lds                      |   11 +----------
 board/RPXlite_dw/u-boot.lds.debug                |    9 +--------
 board/RRvision/u-boot.lds                        |   11 +----------
 board/actux1/u-boot.lds                          |    8 ++------
 board/actux2/u-boot.lds                          |    8 ++------
 board/actux3/u-boot.lds                          |    8 ++------
 board/adder/u-boot.lds                           |   11 +----------
 board/altera/nios2-generic/u-boot.lds            |    8 ++------
 board/amcc/acadia/u-boot-nand.lds                |   11 +----------
 board/amcc/bamboo/u-boot-nand.lds                |   11 +----------
 board/amcc/canyonlands/u-boot-nand.lds           |   11 +----------
 board/amcc/kilauea/u-boot-nand.lds               |   11 +----------
 board/amcc/sequoia/u-boot-nand.lds               |   11 +----------
 board/amcc/sequoia/u-boot-ram.lds                |   11 +----------
 board/amirix/ap1000/u-boot.lds                   |    9 +--------
 board/astro/mcf5373l/u-boot.lds                  |   11 +----------
 board/c2mon/u-boot.lds                           |   11 +----------
 board/c2mon/u-boot.lds.debug                     |    9 +--------
 board/cobra5272/u-boot.lds                       |   10 +---------
 board/cogent/u-boot.lds                          |   11 +----------
 board/cogent/u-boot.lds.debug                    |    9 +--------
 board/cray/L1/u-boot.lds.debug                   |    9 +--------
 board/dave/PPChameleonEVB/u-boot.lds             |   10 +---------
 board/dbau1x00/u-boot.lds                        |    6 +-----
 board/dvlhost/u-boot.lds                         |    8 ++------
 board/eltec/mhpc/u-boot.lds                      |   11 +----------
 board/eltec/mhpc/u-boot.lds.debug                |    9 +--------
 board/emk/top860/u-boot.lds                      |   12 +-----------
 board/emk/top860/u-boot.lds.debug                |    4 +---
 board/ep88x/u-boot.lds                           |   11 +----------
 board/esd/dasa_sim/u-boot.lds                    |   11 +----------
 board/esd/pmc440/u-boot-nand.lds                 |   11 +----------
 board/esd/tasreg/u-boot.lds                      |   10 +---------
 board/esteem192e/u-boot.lds                      |   11 +----------
 board/etx094/u-boot.lds                          |   11 +----------
 board/evb64260/u-boot.lds                        |   11 +----------
 board/fads/u-boot.lds                            |   11 +----------
 board/flagadm/u-boot.lds                         |   11 +----------
 board/flagadm/u-boot.lds.debug                   |    9 +--------
 board/freescale/m5208evbe/u-boot.lds             |   10 +---------
 board/freescale/m52277evb/u-boot.lds             |   10 +---------
 board/freescale/m5235evb/u-boot.lds              |   10 +---------
 board/freescale/m5249evb/u-boot.lds              |   10 +---------
 board/freescale/m5253demo/u-boot.lds             |   10 +---------
 board/freescale/m5253evbe/u-boot.lds             |   10 +---------
 board/freescale/m5271evb/u-boot.lds              |   10 +---------
 board/freescale/m5272c3/u-boot.lds               |   10 +---------
 board/freescale/m5275evb/u-boot.lds              |   10 +---------
 board/freescale/m5282evb/u-boot.lds              |   10 +---------
 board/freescale/m53017evb/u-boot.lds             |   10 +---------
 board/freescale/m5329evb/u-boot.lds              |   10 +---------
 board/freescale/m5373evb/u-boot.lds              |   10 +---------
 board/freescale/m54451evb/u-boot.lds             |   10 +---------
 board/freescale/m54455evb/u-boot.lds             |   10 +---------
 board/freescale/m547xevb/u-boot.lds              |   10 +---------
 board/freescale/m548xevb/u-boot.lds              |   10 +---------
 board/freescale/mx31ads/u-boot.lds               |    5 +----
 board/gaisler/gr_cpci_ax2000/u-boot.lds          |    6 +-----
 board/gaisler/gr_ep2s60/u-boot.lds               |    6 +-----
 board/gaisler/gr_xc3s_1500/u-boot.lds            |    6 +-----
 board/gaisler/grsim/u-boot.lds                   |    6 +-----
 board/gaisler/grsim_leon2/u-boot.lds             |    6 +-----
 board/gen860t/u-boot-flashenv.lds                |   10 +---------
 board/gen860t/u-boot.lds                         |   11 +----------
 board/genietv/u-boot.lds                         |   11 +----------
 board/genietv/u-boot.lds.debug                   |    9 +--------
 board/gth2/u-boot.lds                            |    6 +-----
 board/hermes/u-boot.lds                          |   11 +----------
 board/hermes/u-boot.lds.debug                    |    9 +--------
 board/hymod/u-boot.lds                           |   11 +----------
 board/hymod/u-boot.lds.debug                     |    9 +--------
 board/icu862/u-boot.lds                          |   11 +----------
 board/icu862/u-boot.lds.debug                    |    9 +--------
 board/idmr/u-boot.lds                            |   10 +---------
 board/incaip/u-boot.lds                          |    6 +-----
 board/ip860/u-boot.lds                           |   11 +----------
 board/ip860/u-boot.lds.debug                     |    9 +--------
 board/ivm/u-boot.lds                             |   11 +----------
 board/ivm/u-boot.lds.debug                       |    9 +--------
 board/jornada/u-boot.lds                         |    6 +-----
 board/korat/u-boot-F7FC.lds                      |   11 +----------
 board/kup/kup4k/u-boot.lds                       |   11 +----------
 board/kup/kup4k/u-boot.lds.debug                 |    9 +--------
 board/kup/kup4x/u-boot.lds                       |   11 +----------
 board/kup/kup4x/u-boot.lds.debug                 |    9 +--------
 board/lantec/u-boot.lds                          |   11 +----------
 board/lantec/u-boot.lds.debug                    |    9 +--------
 board/lwmon/u-boot.lds                           |   11 +----------
 board/lwmon/u-boot.lds.debug                     |    9 +--------
 board/manroland/uc100/u-boot.lds                 |   11 +----------
 board/matrix_vision/mvsmr/u-boot.lds             |   11 +----------
 board/mbx8xx/u-boot.lds                          |   11 +----------
 board/mbx8xx/u-boot.lds.debug                    |    9 +--------
 board/micronas/vct/u-boot.lds                    |    7 +------
 board/ml2/u-boot.lds                             |   11 +----------
 board/ml2/u-boot.lds.debug                       |    9 +--------
 board/mousse/u-boot.lds                          |   11 +----------
 board/mousse/u-boot.lds.ram                      |    9 +--------
 board/mousse/u-boot.lds.rom                      |    8 +-------
 board/mpl/pip405/u-boot.lds.debug                |    9 +--------
 board/mvblue/u-boot.lds                          |   11 +----------
 board/netphone/u-boot.lds                        |   11 +----------
 board/netphone/u-boot.lds.debug                  |    9 +--------
 board/netta/u-boot.lds                           |   11 +----------
 board/netta/u-boot.lds.debug                     |    9 +--------
 board/netta2/u-boot.lds                          |   11 +----------
 board/netta2/u-boot.lds.debug                    |    9 +--------
 board/netvia/u-boot.lds                          |   11 +----------
 board/netvia/u-boot.lds.debug                    |    9 +--------
 board/nx823/u-boot.lds                           |   11 +----------
 board/nx823/u-boot.lds.debug                     |    9 +--------
 board/openrisc/openrisc-generic/u-boot.lds       |    4 +---
 board/pb1x00/u-boot.lds                          |    6 +-----
 board/qemu-mips/u-boot.lds                       |    7 +------
 board/qi/qi_lb60/u-boot.lds                      |    4 +---
 board/quantum/u-boot.lds                         |   11 +----------
 board/quantum/u-boot.lds.debug                   |    4 +---
 board/r360mpi/u-boot.lds                         |   11 +----------
 board/rbc823/u-boot.lds                          |   10 +---------
 board/renesas/sh7757lcr/u-boot.lds               |   10 +++-------
 board/rsdproto/u-boot.lds                        |   11 +----------
 board/samsung/smdk6400/u-boot-nand.lds           |    4 +---
 board/sandburst/karef/u-boot.lds.debug           |    9 +--------
 board/sandburst/metrobox/u-boot.lds.debug        |    9 +--------
 board/sandpoint/u-boot.lds                       |   11 +----------
 board/siemens/IAD210/u-boot.lds                  |   11 +----------
 board/sixnet/u-boot.lds                          |   11 +----------
 board/snmc/qs850/u-boot.lds                      |   11 +----------
 board/snmc/qs860t/u-boot.lds                     |   11 +----------
 board/spc1920/u-boot.lds                         |   11 +----------
 board/spd8xx/u-boot.lds                          |   11 +----------
 board/spd8xx/u-boot.lds.debug                    |    9 +--------
 board/stx/stxxtc/u-boot.lds                      |   11 +----------
 board/stx/stxxtc/u-boot.lds.debug                |    9 +--------
 board/svm_sc8xx/u-boot.lds                       |   11 +----------
 board/svm_sc8xx/u-boot.lds.debug                 |    4 +---
 board/tqc/tqm8xx/u-boot.lds                      |   11 +----------
 board/v37/u-boot.lds                             |   11 +----------
 board/w7o/u-boot.lds.debug                       |    9 +--------
 board/westel/amx860/u-boot.lds                   |   11 +----------
 board/westel/amx860/u-boot.lds.debug             |    9 +--------
 board/xes/xpedite1000/u-boot.lds.debug           |    9 +--------
 board/xilinx/microblaze-generic/u-boot.lds       |    8 +-------
 board/zipitz2/u-boot.lds                         |    5 +----
 doc/README.commands                              |    5 +++++
 nand_spl/board/freescale/mx31pdk/Makefile        |    2 +-
 nand_spl/board/freescale/mx31pdk/u-boot.lds      |    5 +----
 nand_spl/board/karo/tx25/Makefile                |    2 +-
 nand_spl/board/karo/tx25/u-boot.lds              |    5 +----
 nand_spl/board/samsung/smdk6400/Makefile         |    2 +-
 nand_spl/board/samsung/smdk6400/u-boot.lds       |    4 +---
 spl/Makefile                                     |    3 ++-
 u-boot-common.lds                                |   14 ++++++++++++++
 198 files changed, 234 insertions(+), 1554 deletions(-)
 create mode 100644 u-boot-common.lds
arch/arm/cpu/arm1136/u-boot.lds +1 -6
index d1e2851..cd7927c 100644
@@ -52,12 +52,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/arm1176/u-boot.lds +1 -4
index 27d6638..9852b0a 100644
@@ -43,10 +43,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/arm720t/u-boot.lds +1 -6
index 9370fad..647e457 100644
@@ -42,12 +42,7 @@ SECTIONS
 	.data : {
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/arm920t/ep93xx/u-boot.lds +1 -4
index dc6ba34..7a8c3af 100644
@@ -47,10 +47,7 @@ SECTIONS
 	. = ALIGN(4);
 	.got : { *(.got) }
 
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 	__bss_start = .;
arch/arm/cpu/arm920t/u-boot.lds +1 -6
index 17ba604..b6c3e59 100644
@@ -51,12 +51,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/arm925t/u-boot.lds +1 -6
index 64e76f5..c73b5c9 100644
@@ -46,12 +46,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds +1 -4
index 0fccd52..6a7d4c7 100644
@@ -49,10 +49,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/arm926ejs/u-boot.lds +1 -6
index 1480e0c..3cf1840 100644
@@ -43,12 +43,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/arm946es/u-boot.lds +1 -6
index ff938e4..7311292 100644
@@ -43,12 +43,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/arm_intcm/u-boot.lds +1 -6
index f4a146c..938c597 100644
@@ -43,12 +43,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/armv7/u-boot.lds +2 -6
index 40ecf78..8ed42c4 100644
@@ -31,6 +31,7 @@ SECTIONS
 {
 	. = 0x00000000;
 
+
 	. = ALIGN(4);
 	.text	:
 	{
@@ -46,12 +47,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/ixp/u-boot.lds +1 -6
index 7199de4..c613e47 100644
@@ -43,12 +43,7 @@ SECTIONS
 		*(.data*)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/lh7a40x/u-boot.lds +1 -6
index 30934ff..794635f 100644
@@ -43,12 +43,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/pxa/u-boot.lds +1 -6
index e86e781..b7cbb93 100644
@@ -43,12 +43,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/s3c44b0/u-boot.lds +1 -6
index 74a259c..8613ef6 100644
@@ -43,12 +43,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/arm/cpu/sa1100/u-boot.lds +1 -6
index e6381da..3cc2db4 100644
@@ -46,12 +46,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/avr32/cpu/u-boot.lds +1 -7
index 0e532f2..b52f668 100644
@@ -45,13 +45,7 @@ SECTIONS
 		*(.data)
 		*(.data.*)
 	}
-
-	. = ALIGN(4);
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : {
-		KEEP(*(.u_boot_cmd))
-	}
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 	_got = .;
arch/blackfin/cpu/u-boot.lds +6 -9
index 2b8d285..11545bc 100644
@@ -61,15 +61,17 @@ OUTPUT_ARCH(bfin)
 MEMORY
 {
 #if CONFIG_MEM_SIZE
-	ram     : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
 # define ram_code ram
 # define ram_data ram
+	ram (rwx)    : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
+	l1_code : ORIGIN = L1_CODE_ORIGIN,          LENGTH = L1_INST_SRAM_SIZE
+	l1_data : ORIGIN = L1_DATA_B_SRAM,          LENGTH = L1_DATA_B_SRAM_SIZE
 #else
 # define ram_code l1_code
 # define ram_data l1_data
+	l1_code (rx)  : ORIGIN = L1_CODE_ORIGIN,          LENGTH = L1_INST_SRAM_SIZE
+	l1_data (!rx) : ORIGIN = L1_DATA_B_SRAM,          LENGTH = L1_DATA_B_SRAM_SIZE
 #endif
-	l1_code : ORIGIN = L1_CODE_ORIGIN,          LENGTH = L1_INST_SRAM_SIZE
-	l1_data : ORIGIN = L1_DATA_B_SRAM,          LENGTH = L1_DATA_B_SRAM_SIZE
 }
 
 ENTRY(_start)
@@ -112,12 +114,7 @@ SECTIONS
 		CONSTRUCTORS
 	} >ram_data
 
-	.u_boot_cmd :
-	{
-		___u_boot_cmd_start = .;
-		*(.u_boot_cmd)
-		___u_boot_cmd_end = .;
-	} >ram_data
+	INCLUDE u-boot-common.lds
 
 	.text_l1 :
 	{
arch/nds32/cpu/n1213/u-boot.lds +1 -4
index 1903420..1417827 100644
@@ -51,10 +51,7 @@ SECTIONS
 		__got_end = .;
 	}
 
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
arch/nios2/cpu/u-boot.lds +2 -6
index 4856bd3..17ab214 100644
@@ -45,13 +45,9 @@ SECTIONS
 	 * the initialization code relocates the command table as
 	 * well -- admittedly, this is just pure laziness ;-)
 	 */
-	__u_boot_cmd_start = .;
-	.u_boot_cmd :
-	{
-	  *(.u_boot_cmd)
-	}
+	INCLUDE u-boot-common.lds
+
 	. = ALIGN(4);
-	__u_boot_cmd_end = .;
 
 	/* INIT DATA sections - "Small" data (see the gcc -G option)
 	 * is always gp-relative. Here we make all init data sections
arch/powerpc/cpu/74xx_7xx/u-boot.lds +1 -10
index 24823cd..219e265 100644
@@ -61,16 +61,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
arch/powerpc/cpu/mpc512x/u-boot.lds +1 -10
index 7a4d927..3d0f805 100644
@@ -56,16 +56,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
arch/powerpc/cpu/mpc5xx/u-boot.lds +1 -10
index e02b213..91c4957 100644
@@ -64,16 +64,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds +1 -10
index 0c6c54e..c0d8976 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
arch/powerpc/cpu/mpc5xxx/u-boot.lds +1 -10
index 5dcaec1..5370c41 100644
@@ -59,16 +59,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
arch/powerpc/cpu/mpc8220/u-boot.lds +1 -10
index 39bb42e..a045604 100644
@@ -58,16 +58,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
arch/powerpc/cpu/mpc824x/u-boot.lds +1 -10
index b30ce76..5181044 100644
@@ -59,16 +59,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
arch/powerpc/cpu/mpc8260/u-boot.lds +1 -10
index 60b71ec..853f413 100644
@@ -58,16 +58,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
arch/powerpc/cpu/mpc83xx/u-boot.lds +1 -10
index 2f4b9ad..3623783 100644
@@ -57,16 +57,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
arch/powerpc/cpu/mpc85xx/u-boot-nand.lds +1 -9
index 04bc731..1e571d0 100644
@@ -68,15 +68,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
arch/powerpc/cpu/mpc85xx/u-boot.lds +1 -9
index efe34b7..976731e 100644
@@ -76,15 +76,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
arch/powerpc/cpu/mpc86xx/u-boot.lds +1 -9
index 121e529..f87f1da 100644
@@ -63,15 +63,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
arch/powerpc/cpu/ppc4xx/u-boot.lds +1 -9
index 2466b79..85bc286 100644
@@ -77,15 +77,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
arch/sandbox/cpu/u-boot.lds +1 -3
index 2d2e50f..1149641 100644
@@ -24,9 +24,7 @@
 
 SECTIONS
 {
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
   __bss_start = .;
 
 }
arch/sh/cpu/sh2/u-boot.lds +2 -7
index b86a822..258f6ce 100644
@@ -72,13 +72,8 @@ SECTIONS
 	}
 	PROVIDE (_egot = .);
 
-	PROVIDE (__u_boot_cmd_start = .);
-	.u_boot_cmd :
-	{
-		*(.u_boot_cmd)
-		. = ALIGN(4);
-	}
-	PROVIDE (__u_boot_cmd_end = .);
+	INCLUDE u-boot-common.lds
+	. = ALIGN(4);
 
 	PROVIDE (reloc_dst_end = .);
 
arch/sh/cpu/sh3/u-boot.lds +3 -7
index 9bf8503..e2674fd 100644
@@ -78,13 +78,9 @@ SECTIONS
 	}
 	PROVIDE (_egot = .);
 
-	PROVIDE (__u_boot_cmd_start = .);
-	.u_boot_cmd :
-	{
-		*(.u_boot_cmd)
-		. = ALIGN(4);
-	}
-	PROVIDE (__u_boot_cmd_end = .);
+	INCLUDE u-boot-common.lds
+
+	. = ALIGN(4);
 
 	PROVIDE (reloc_dst_end = .);
 	/* _reloc_dst_end = .; */
arch/sh/cpu/sh4/u-boot.lds +2 -7
index d9c70bc..b656711 100644
@@ -75,14 +75,9 @@ SECTIONS
 	}
 	PROVIDE (_egot = .);
 
-	PROVIDE (__u_boot_cmd_start = .);
-	.u_boot_cmd :
-	{
-		*(.u_boot_cmd)
-		. = ALIGN(4);
-	}
-	PROVIDE (__u_boot_cmd_end = .);
+	INCLUDE u-boot-common.lds
 
+	. = ALIGN(4);
 	PROVIDE (reloc_dst_end = .);
 	/* _reloc_dst_end = .; */
 
arch/x86/cpu/u-boot.lds +1 -5
index fe28030..cb085cb 100644
@@ -32,11 +32,7 @@ SECTIONS
 	__text_start = .;
 	.text  : { *(.text*); }
 
-	. = ALIGN(4);
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	. = ALIGN(4);
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 	.rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) }
board/BuS/EB+MCF-EV123/u-boot.lds +1 -9
index 4ba1964..99fc5c8 100644
@@ -64,15 +64,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/LEOX/elpt860/u-boot.lds +1 -9
index 5aaf6b3..b26d711 100644
@@ -85,15 +85,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/LEOX/elpt860/u-boot.lds.debug +1 -3
index 92901b1..0c797a9 100644
@@ -115,9 +115,7 @@ SECTIONS
   _edata  =  .;
   PROVIDE (edata = .);
 
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/RPXClassic/u-boot.lds +1 -10
index d0b60cf..a6b6939 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/RPXClassic/u-boot.lds.debug +1 -8
index 99c48f2..706211c 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/RPXlite/u-boot.lds +1 -10
index d0b60cf..a6b6939 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/RPXlite/u-boot.lds.debug +1 -8
index 99c48f2..706211c 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/RPXlite_dw/u-boot.lds +1 -10
index d0b60cf..a6b6939 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/RPXlite_dw/u-boot.lds.debug +1 -8
index 4491edd..11710ca 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/RRvision/u-boot.lds +1 -10
index 8385373..5a1878e 100644
@@ -70,16 +70,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/actux1/u-boot.lds +2 -6
index 9dbaa6f..834aaf5 100644
@@ -53,12 +53,8 @@ SECTIONS
 	.got : {
 		*(.got)
 	}
-	. =.;
-	__u_boot_cmd_start =.;
-	.u_boot_cmd : {
-		*(.u_boot_cmd)
-	}
-	__u_boot_cmd_end =.;
+
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN (4);
 	.rel.dyn : {
board/actux2/u-boot.lds +2 -6
index 3575ed9..918e8d5 100644
@@ -53,12 +53,8 @@ SECTIONS
 	.got : {
 		*(.got)
 	}
-	. =.;
-	__u_boot_cmd_start =.;
-	.u_boot_cmd : {
-		*(.u_boot_cmd)
-	}
-	__u_boot_cmd_end =.;
+
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN (4);
 	.rel.dyn : {
board/actux3/u-boot.lds +2 -6
index 35aab29..77b0880 100644
@@ -53,12 +53,8 @@ SECTIONS
 	.got : {
 		*(.got)
 	}
-	. =.;
-	__u_boot_cmd_start =.;
-	.u_boot_cmd : {
-		*(.u_boot_cmd)
-	}
-	__u_boot_cmd_end =.;
+
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN (4);
 	.rel.dyn : {
board/adder/u-boot.lds +1 -10
index a762769..9fb8133 100644
@@ -61,16 +61,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/altera/nios2-generic/u-boot.lds +2 -6
index 88ced62..e0d9528 100644
@@ -46,13 +46,9 @@ SECTIONS
 	 * the initialization code relocates the command table as
 	 * well -- admittedly, this is just pure laziness ;-)
 	 */
-	__u_boot_cmd_start = .;
-	.u_boot_cmd :
-	{
-	  *(.u_boot_cmd)
-	}
+	INCLUDE u-boot-common.lds
+
 	. = ALIGN(4);
-	__u_boot_cmd_end = .;
 
 	/* INIT DATA sections - "Small" data (see the gcc -G option)
 	 * is always gp-relative. Here we make all init data sections
board/amcc/acadia/u-boot-nand.lds +1 -10
index ab67de2..d1215cd 100644
@@ -71,16 +71,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/amcc/bamboo/u-boot-nand.lds +1 -10
index 3ad8709..eee17ed 100644
@@ -72,16 +72,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/amcc/canyonlands/u-boot-nand.lds +1 -10
index 76f89f1..1a54c32 100644
@@ -72,16 +72,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/amcc/kilauea/u-boot-nand.lds +1 -10
index ab67de2..d1215cd 100644
@@ -71,16 +71,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/amcc/sequoia/u-boot-nand.lds +1 -10
index 07ae8b1..5055dcd 100644
@@ -72,16 +72,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/amcc/sequoia/u-boot-ram.lds +1 -10
index 423400a..d3805b6 100644
@@ -63,16 +63,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/amirix/ap1000/u-boot.lds +1 -8
index cd8f5ce..27b87cb 100644
@@ -67,14 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/astro/mcf5373l/u-boot.lds +1 -10
index a1d8e0f..7aa98b4 100644
@@ -108,16 +108,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/c2mon/u-boot.lds +1 -10
index b9b8e3c..12da280 100644
@@ -73,16 +73,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/c2mon/u-boot.lds.debug +1 -8
index c771102..03c0c24 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/cobra5272/u-boot.lds +1 -9
index c4039ed..ad9fbd2 100644
@@ -67,15 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/cogent/u-boot.lds +1 -10
index 2393d8d..af85c97 100644
@@ -69,16 +69,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/cogent/u-boot.lds.debug +1 -8
index 99c48f2..706211c 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/cray/L1/u-boot.lds.debug +1 -8
index fcf8ebb..240f77c 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/dave/PPChameleonEVB/u-boot.lds +1 -9
index 3b10114..058ffdc 100644
@@ -73,15 +73,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/dbau1x00/u-boot.lds +1 -5
index 4a59cea..dafd8a0 100644
@@ -54,11 +54,7 @@ SECTIONS
 
 	.sdata  : { *(.sdata*) }
 
-	.u_boot_cmd : {
-	  __u_boot_cmd_start = .;
-	  *(.u_boot_cmd)
-	  __u_boot_cmd_end = .;
-	}
+	INCLUDE u-boot-common.lds
 
 	uboot_end_data = .;
 	num_got_entries = (__got_end - __got_start) >> 2;
board/dvlhost/u-boot.lds +2 -6
index 01ec390..f6f72ed 100644
@@ -53,12 +53,8 @@ SECTIONS
 	.got : {
 		*(.got)
 	}
-	. =.;
-	__u_boot_cmd_start =.;
-	.u_boot_cmd : {
-		*(.u_boot_cmd)
-	}
-	__u_boot_cmd_end =.;
+
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN (4);
 	.rel.dyn : {
board/eltec/mhpc/u-boot.lds +1 -10
index fd4e8a5..41d1c6f 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/eltec/mhpc/u-boot.lds.debug +1 -8
index c771102..03c0c24 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/emk/top860/u-boot.lds +1 -11
index fb06648..a6b6939 100644
@@ -65,17 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/emk/top860/u-boot.lds.debug +1 -3
index 39807d4..5d9e8f7 100644
@@ -107,9 +107,7 @@ SECTIONS
   _edata  =  .;
   PROVIDE (edata = .);
 
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/ep88x/u-boot.lds +1 -10
index 332b35a..605effc 100644
@@ -61,16 +61,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/esd/dasa_sim/u-boot.lds +1 -10
index b15948d..c41d994 100644
@@ -72,16 +72,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/esd/pmc440/u-boot-nand.lds +1 -10
index 71f0fd2..135518d 100644
@@ -101,16 +101,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/esd/tasreg/u-boot.lds +1 -9
index f697ccd..e3fae2a 100644
@@ -64,15 +64,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/esteem192e/u-boot.lds +1 -10
index 163b83d..26ee28d 100644
@@ -74,16 +74,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/etx094/u-boot.lds +1 -10
index b00d2b3..ae3edde 100644
@@ -75,16 +75,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/evb64260/u-boot.lds +1 -10
index 2d031ef..d1638be 100644
@@ -69,16 +69,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/fads/u-boot.lds +1 -10
index 9ea0674..5d6cdb2 100644
@@ -67,16 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/flagadm/u-boot.lds +1 -10
index fd4e8a5..41d1c6f 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/flagadm/u-boot.lds.debug +1 -8
index c771102..03c0c24 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/freescale/m5208evbe/u-boot.lds +1 -9
index 6e39be1..f40a959 100644
@@ -68,15 +68,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m52277evb/u-boot.lds +1 -9
index 3e9f4c3..fd1c051 100644
@@ -67,15 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m5235evb/u-boot.lds +1 -9
index d39e734..234b774 100644
@@ -67,15 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m5249evb/u-boot.lds +1 -9
index c4039ed..ad9fbd2 100644
@@ -67,15 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m5253demo/u-boot.lds +1 -9
index cbd2831..c4e254f 100644
@@ -68,15 +68,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m5253evbe/u-boot.lds +1 -9
index c4039ed..ad9fbd2 100644
@@ -67,15 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m5271evb/u-boot.lds +1 -9
index 4717036..813668b 100644
@@ -67,15 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m5272c3/u-boot.lds +1 -9
index c4039ed..ad9fbd2 100644
@@ -67,15 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m5275evb/u-boot.lds +1 -9
index 6c2dfe8..254ed11 100644
@@ -67,15 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m5282evb/u-boot.lds +1 -9
index 4ba1964..99fc5c8 100644
@@ -64,15 +64,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m53017evb/u-boot.lds +1 -9
index 80935f2..f74e334 100644
@@ -70,15 +70,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m5329evb/u-boot.lds +1 -9
index 40af8bc..39ae0cc 100644
@@ -68,15 +68,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m5373evb/u-boot.lds +1 -9
index 19342ac..2b4772f 100644
@@ -68,15 +68,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m54451evb/u-boot.lds +1 -9
index 45924b7..472f3f5 100644
@@ -65,15 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m54455evb/u-boot.lds +1 -9
index f341449..59611ba 100644
@@ -65,15 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m547xevb/u-boot.lds +1 -9
index 5472689..ea3b84b 100644
@@ -65,15 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/m548xevb/u-boot.lds +1 -9
index cf3f38c..99211d4 100644
@@ -65,15 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/freescale/mx31ads/u-boot.lds +1 -4
index 79eb7ac..ab68a95 100644
@@ -56,10 +56,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
board/gaisler/gr_cpci_ax2000/u-boot.lds +1 -5
index 87cb8e3..88a0213 100644
@@ -84,11 +84,7 @@ SECTIONS
 	_etext = .;
 
 	/* CMD Table */
-
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	. = ALIGN(4);
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	.data	:
 	{
board/gaisler/gr_ep2s60/u-boot.lds +1 -5
index 2fb44aa..8b71ee6 100644
@@ -84,11 +84,7 @@ SECTIONS
 	_etext = .;
 
 	/* CMD Table */
-
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	. = ALIGN(4);
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	.data	:
 	{
board/gaisler/gr_xc3s_1500/u-boot.lds +1 -5
index 8719e97..0600a1e 100644
@@ -84,11 +84,7 @@ SECTIONS
 	_etext = .;
 
 	/* CMD Table */
-
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	. = ALIGN(4);
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	.data	:
 	{
board/gaisler/grsim/u-boot.lds +1 -5
index 33890b5..f5e8b85 100644
@@ -83,11 +83,7 @@ SECTIONS
 	_etext = .;
 
 	/* CMD Table */
-
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	. = ALIGN(4);
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	.data	:
 	{
board/gaisler/grsim_leon2/u-boot.lds +1 -5
index cf6e502..f4e53ae 100644
@@ -83,11 +83,7 @@ SECTIONS
 	_etext = .;
 
 	/* CMD Table */
-
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	. = ALIGN(4);
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	.data	:
 	{
board/gen860t/u-boot-flashenv.lds +1 -9
index 5bb6c62..ec26803 100644
@@ -70,15 +70,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/gen860t/u-boot.lds +1 -10
index be99b51..d93b805 100644
@@ -70,16 +70,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/genietv/u-boot.lds +1 -10
index 1d66a9b..6fa88ef 100644
@@ -79,16 +79,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/genietv/u-boot.lds.debug +1 -8
index cfa4ef3..ca6b4d6 100644
@@ -107,14 +107,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/gth2/u-boot.lds +1 -5
index 9fc417f..5f5afb6 100644
@@ -54,11 +54,7 @@ SECTIONS
 
 	.sdata  : { *(.sdata*) }
 
-	.u_boot_cmd : {
-	  __u_boot_cmd_start = .;
-	  *(.u_boot_cmd)
-	  __u_boot_cmd_end = .;
-	}
+	INCLUDE u-boot-common.lds
 
 	uboot_end_data = .;
 	num_got_entries = (__got_end - __got_start) >> 2;
board/hermes/u-boot.lds +1 -10
index ca97115..2541de2 100644
@@ -71,16 +71,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/hermes/u-boot.lds.debug +1 -8
index 8a197de..38270a9 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/hymod/u-boot.lds +1 -10
index 1309f20..25c61ab 100644
@@ -109,16 +109,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/hymod/u-boot.lds.debug +1 -8
index 99c48f2..706211c 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/icu862/u-boot.lds +1 -10
index 93c79a6..59162d9 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/icu862/u-boot.lds.debug +1 -8
index 91d3e67..9671b6d 100644
@@ -107,14 +107,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/idmr/u-boot.lds +1 -9
index f697ccd..e3fae2a 100644
@@ -64,15 +64,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/incaip/u-boot.lds +1 -5
index 4a59cea..dafd8a0 100644
@@ -54,11 +54,7 @@ SECTIONS
 
 	.sdata  : { *(.sdata*) }
 
-	.u_boot_cmd : {
-	  __u_boot_cmd_start = .;
-	  *(.u_boot_cmd)
-	  __u_boot_cmd_end = .;
-	}
+	INCLUDE u-boot-common.lds
 
 	uboot_end_data = .;
 	num_got_entries = (__got_end - __got_start) >> 2;
board/ip860/u-boot.lds +1 -10
index d0b60cf..a6b6939 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/ip860/u-boot.lds.debug +1 -8
index 2f61b11..f824ee7 100644
@@ -107,14 +107,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/ivm/u-boot.lds +1 -10
index 1e843eb..d5f6f52 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/ivm/u-boot.lds.debug +1 -8
index 732a46f..a7b3dde 100644
@@ -107,14 +107,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/jornada/u-boot.lds +1 -5
index c75b21f..02484c5 100644
@@ -45,11 +45,7 @@ SECTIONS
 	. = ALIGN(4);
 	.got : { *(.got) }
 
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 	__bss_start = .;
board/korat/u-boot-F7FC.lds +1 -10
index 6a017e3..1e342e4 100644
@@ -107,16 +107,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/kup/kup4k/u-boot.lds +1 -10
index d0b60cf..a6b6939 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/kup/kup4k/u-boot.lds.debug +1 -8
index 4491edd..11710ca 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/kup/kup4x/u-boot.lds +1 -10
index d0b60cf..a6b6939 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/kup/kup4x/u-boot.lds.debug +1 -8
index 4491edd..11710ca 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/lantec/u-boot.lds +1 -10
index de0b355..c5d6425 100644
@@ -74,16 +74,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/lantec/u-boot.lds.debug +1 -8
index 856a99b..af83ad6 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/lwmon/u-boot.lds +1 -10
index 8bf7324..1ca90fe 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/lwmon/u-boot.lds.debug +1 -8
index 2412234..dffe7c5 100644
@@ -107,14 +107,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/manroland/uc100/u-boot.lds +1 -10
index 731cec9..aac4312 100644
@@ -68,16 +68,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/matrix_vision/mvsmr/u-boot.lds +1 -10
index 57c37de..8e46a5e 100644
@@ -73,16 +73,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/mbx8xx/u-boot.lds +1 -10
index d0b60cf..a6b6939 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/mbx8xx/u-boot.lds.debug +1 -8
index a95c47f..5d9e8f7 100644
@@ -107,14 +107,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/micronas/vct/u-boot.lds +1 -6
index 3a05ef9..417661b 100644
@@ -52,12 +52,7 @@ SECTIONS
 	. = ALIGN(4);
 	.sdata  : { *(.sdata*) }
 
-	. = ALIGN(4);
-	.u_boot_cmd : {
-	  __u_boot_cmd_start = .;
-	  *(.u_boot_cmd)
-	  __u_boot_cmd_end = .;
-	}
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 	uboot_end_data = .;
board/ml2/u-boot.lds +1 -10
index 9f9ddb8..aa4b16a 100644
@@ -63,16 +63,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/ml2/u-boot.lds.debug +1 -8
index fcf8ebb..240f77c 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/mousse/u-boot.lds +1 -10
index dae2cfc..3e63555 100644
@@ -59,16 +59,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/mousse/u-boot.lds.ram +1 -8
index b3364be..782755b 100644
@@ -85,14 +85,7 @@ SECTIONS
   } > ram
   */
 
-  __u_boot_cmd_start = .;
-  .u_boot_cmd : { *(.u_boot_cmd) }
-  __u_boot_cmd_end = .;
-
-   __start___ex_table = .;
-    __ex_table : { *(__ex_table) } > ram
-    __stop___ex_table = .;
-
+  INCLUDE u-boot-common.lds
 
   .ppcenv	:
   {
board/mousse/u-boot.lds.rom +1 -7
index b4b9e02..7c9040f 100644
@@ -102,13 +102,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/mpl/pip405/u-boot.lds.debug +1 -8
index fcf8ebb..240f77c 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/mvblue/u-boot.lds +1 -10
index 11624d2..772ec37 100644
@@ -69,16 +69,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/netphone/u-boot.lds +1 -10
index a949e4f..310ad2d 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/netphone/u-boot.lds.debug +1 -8
index a001f3f..be45472 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/netta/u-boot.lds +1 -10
index a949e4f..310ad2d 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/netta/u-boot.lds.debug +1 -8
index a001f3f..be45472 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/netta2/u-boot.lds +1 -10
index a949e4f..310ad2d 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/netta2/u-boot.lds.debug +1 -8
index a001f3f..be45472 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/netvia/u-boot.lds +1 -10
index a949e4f..310ad2d 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/netvia/u-boot.lds.debug +1 -8
index 6c7d698..f71dea1 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/nx823/u-boot.lds +1 -10
index fd4e8a5..41d1c6f 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/nx823/u-boot.lds.debug +1 -8
index c771102..03c0c24 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/openrisc/openrisc-generic/u-boot.lds +1 -3
index 1aed197..5c7556f 100644
@@ -26,9 +26,7 @@ SECTIONS
 		_endtext = .;
 	}  > ram
 
-	 __u_boot_cmd_start = .;
-	 .u_boot_cmd : { *(.u_boot_cmd) } > ram
-	 __u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	.rodata : {
 		*(.rodata);
board/pb1x00/u-boot.lds +1 -5
index bd0dee1..86107f0 100644
@@ -54,11 +54,7 @@ SECTIONS
 
 	.sdata  : { *(.sdata*) }
 
-	.u_boot_cmd : {
-	  __u_boot_cmd_start = .;
-	  *(.u_boot_cmd)
-	  __u_boot_cmd_end = .;
-	}
+	INCLUDE u-boot-common.lds
 
 	uboot_end_data = .;
 	num_got_entries = (__got_end - __got_start) >> 2;
board/qemu-mips/u-boot.lds +1 -6
index 9460b20..5279103 100644
@@ -55,12 +55,7 @@ SECTIONS
 	. = ALIGN(4);
 	.sdata  : { *(.sdata*) }
 
-	. = .;
-	.u_boot_cmd : {
-	__u_boot_cmd_start = .;
-	*(.u_boot_cmd)
-	__u_boot_cmd_end = .;
-	}
+	INCLUDE u-boot-common.lds
 
 	uboot_end_data = .;
 	num_got_entries = (__got_end - __got_start) >> 2;
board/qi/qi_lb60/u-boot.lds +1 -3
index 7317652..9038db9 100644
@@ -47,9 +47,7 @@ SECTIONS
 
 	.sdata  : { *(.sdata*) }
 
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	uboot_end_data = .;
 	num_got_entries = (__got_end - __got_start) >> 2;
board/quantum/u-boot.lds +1 -10
index d0b60cf..a6b6939 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/quantum/u-boot.lds.debug +1 -3
index abc4640..706211c 100644
@@ -106,9 +106,7 @@ SECTIONS
   _edata  =  .;
   PROVIDE (edata = .);
 
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/r360mpi/u-boot.lds +1 -10
index 2fa085a..681b46b 100644
@@ -67,16 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/rbc823/u-boot.lds +1 -9
index d943fb6..34898a1 100644
@@ -76,15 +76,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/renesas/sh7757lcr/u-boot.lds +3 -7
index 38ebe88..201338c 100644
@@ -77,13 +77,9 @@ SECTIONS
 	}
 	PROVIDE (_egot = .);
 
-	PROVIDE (__u_boot_cmd_start = .);
-	.u_boot_cmd :
-	{
-		*(.u_boot_cmd)
-		. = ALIGN(4);
-	}
-	PROVIDE (__u_boot_cmd_end = .);
+	INCLUDE u-boot-common.lds
+
+	. = ALIGN(4);
 
 	PROVIDE (reloc_dst_end = .);
 	/* _reloc_dst_end = .; */
board/rsdproto/u-boot.lds +1 -10
index a729c52..f77e20a 100644
@@ -96,16 +96,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/samsung/smdk6400/u-boot-nand.lds +1 -3
index f162815..94e00ba 100644
@@ -47,9 +47,7 @@ SECTIONS
 	. = ALIGN(4);
 	.got : { *(.got) }
 
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 	.mmudata : { *(.mmudata) }
board/sandburst/karef/u-boot.lds.debug +1 -8
index 31746e3..75eda9b 100644
@@ -115,14 +115,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/sandburst/metrobox/u-boot.lds.debug +1 -8
index 4922bd2..0574121 100644
@@ -115,14 +115,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/sandpoint/u-boot.lds +1 -10
index e382fd1..1127e57 100644
@@ -67,16 +67,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/siemens/IAD210/u-boot.lds +1 -10
index 0e78e4f..28b81fc 100644
@@ -74,16 +74,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/sixnet/u-boot.lds +1 -10
index 02d1980..0982f80 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/snmc/qs850/u-boot.lds +1 -10
index 9ab248a..cb094b0 100644
@@ -68,16 +68,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/snmc/qs860t/u-boot.lds +1 -10
index d0b60cf..a6b6939 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/spc1920/u-boot.lds +1 -10
index d0b60cf..a6b6939 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/spd8xx/u-boot.lds +1 -10
index a84e7fd..b8f861e 100644
@@ -74,16 +74,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/spd8xx/u-boot.lds.debug +1 -8
index a95c47f..5d9e8f7 100644
@@ -107,14 +107,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/stx/stxxtc/u-boot.lds +1 -10
index a949e4f..310ad2d 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/stx/stxxtc/u-boot.lds.debug +1 -8
index a001f3f..be45472 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/svm_sc8xx/u-boot.lds +1 -10
index c65f022..abbb359 100644
@@ -82,16 +82,7 @@ SECTIONS
   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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/svm_sc8xx/u-boot.lds.debug +1 -3
index abc4640..706211c 100644
@@ -106,9 +106,7 @@ SECTIONS
   _edata  =  .;
   PROVIDE (edata = .);
 
-  __start___ex_table = .;
-  __ex_table : { *(__ex_table) }
-  __stop___ex_table = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/tqc/tqm8xx/u-boot.lds +1 -10
index 4f08be6..009b2c7 100644
@@ -82,16 +82,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/v37/u-boot.lds +1 -10
index e62d53d..ae8b465 100644
@@ -65,16 +65,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/w7o/u-boot.lds.debug +1 -8
index 1c67b30..3f485d7 100644
@@ -106,14 +106,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/westel/amx860/u-boot.lds +1 -10
index 3470b43..4c7dc81 100644
@@ -74,16 +74,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/westel/amx860/u-boot.lds.debug +1 -8
index 91d3e67..9671b6d 100644
@@ -107,14 +107,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(4096);
   __init_begin = .;
board/xes/xpedite1000/u-boot.lds.debug +1 -8
index e2e66ae..a368d0c 100644
@@ -111,14 +111,7 @@ SECTIONS
   _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 = .;
+  INCLUDE u-boot-common.lds
 
   . = ALIGN(256);
   __init_begin = .;
board/xilinx/microblaze-generic/u-boot.lds +1 -7
index ee41145..3dd36dd 100644
@@ -49,13 +49,7 @@ SECTIONS
 		__data_end = .;
 	}
 
-	.u_boot_cmd ALIGN(0x4):
-	{
-		. = .;
-		__u_boot_cmd_start = .;
-		*(.u_boot_cmd)
-		__u_boot_cmd_end = .;
-	}
+	INCLUDE u-boot-common.lds
 
 	.bss ALIGN(0x4):
 	{
board/zipitz2/u-boot.lds +1 -4
index e1a1ff1..8002c2a 100644
@@ -44,10 +44,7 @@ SECTIONS
 	. = ALIGN(4);
 	.got : { *(.got) }
 
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 	__bss_start = .;
doc/README.commands +5 -0
index d678992..7453ebf 100644
@@ -29,3 +29,8 @@ by writing in u-boot.lds ($(TOPDIR)/board/boardname/u-boot.lds) these
 	__u_boot_cmd_start = .;
 	.u_boot_cmd : { *(.u_boot_cmd) }
 	__u_boot_cmd_end = .;
+
+	or
+
+	INCLUDE u-boot-common.lds
+
nand_spl/board/freescale/mx31pdk/Makefile +1 -1
index 87784d2..ac92cdc 100644
@@ -6,7 +6,7 @@ include $(TOPDIR)/config.mk
 nandobj	:= $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
-LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
+LDFLAGS := -L$(TOPDIR) -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
 AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
nand_spl/board/freescale/mx31pdk/u-boot.lds +1 -4
index d2b08f6..ac29811 100644
@@ -45,10 +45,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
nand_spl/board/karo/tx25/Makefile +1 -1
index 0336346..29ca30c 100644
@@ -27,7 +27,7 @@ include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 nandobj	:= $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
-LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
+LDFLAGS := -L$(TOPDIR) -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
 AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
nand_spl/board/karo/tx25/u-boot.lds +1 -4
index d2b08f6..ac29811 100644
@@ -45,10 +45,7 @@ SECTIONS
 		*(.data)
 	}
 
-	. = ALIGN(4);
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
nand_spl/board/samsung/smdk6400/Makefile +1 -1
index c9e75ba..9a2a8d3 100644
@@ -32,7 +32,7 @@ include $(TOPDIR)/nand_spl/board/$(BOARDDIR)/config.mk
 nandobj	:= $(OBJTREE)/nand_spl/
 
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
-LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
+LDFLAGS := -L$(TOPDIR) -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 		$(LDFLAGS_FINAL) -gc-sections
 AFLAGS	+= -DCONFIG_NAND_SPL
 CFLAGS	+= -DCONFIG_NAND_SPL -ffunction-sections
nand_spl/board/samsung/smdk6400/u-boot.lds +1 -3
index 567f635..1c550c0 100644
@@ -50,9 +50,7 @@ SECTIONS
 	. = ALIGN(4);
 	.got : { *(.got) }
 
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
 	. = ALIGN(4);
 
spl/Makefile +2 -1
index 3262e22..1848a86 100644
@@ -124,7 +124,8 @@ $(obj)u-boot-spl.bin:	$(obj)u-boot-spl
 GEN_UBOOT = \
 	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
 	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
-	cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__START) \
+	cd $(obj) && $(LD) -L$(TOPDIR) $(LDFLAGS) $(LDFLAGS_$(@F)) \
+		$$UNDEF_SYM $(__START) \
 		--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
 		-Map u-boot-spl.map -o u-boot-spl
 
u-boot-common.lds new file +14 -0
new file mode 100644
index 0000000..e9a5fc9
@@ -0,0 +1,14 @@
+	. = ALIGN(4);
+	__u_boot_cmd_start = .;
+	.u_boot_cmd : {
+		KEEP(*(.u_boot_cmd))
+	}
+	__u_boot_cmd_end = .;
+
+	/* powerpc specific, but harmless for others */
+	. = ALIGN(4);
+	__start___ex_table = .;
+	__ex_table : {
+		KEEP(*(__ex_table))
+	}
+	__stop___ex_table = .;
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 2/2 RFC: Let linker create phy array

---
 drivers/net/phy/atheros.c    |    9 +--------
 drivers/net/phy/broadcom.c   |   15 +++------------
 drivers/net/phy/davicom.c    |    9 +--------
 drivers/net/phy/lxt.c        |    9 +--------
 drivers/net/phy/marvell.c    |   24 ++++++------------------
 drivers/net/phy/micrel.c     |   12 ++----------
 drivers/net/phy/natsemi.c    |    9 +--------
 drivers/net/phy/phy.c        |   39 +++++----------------------------------
 drivers/net/phy/realtek.c    |    9 +--------
 drivers/net/phy/smsc.c       |   15 +++------------
 drivers/net/phy/teranetics.c |    9 +--------
 drivers/net/phy/vitesse.c    |   30 ++++++++----------------------
 include/phy.h                |    3 +++
 u-boot-common.lds            |    7 +++++++
 14 files changed, 43 insertions(+), 156 deletions(-)
drivers/net/phy/atheros.c +1 -8
index 798473d..ad82256 100644
@@ -30,7 +30,7 @@ static int ar8021_config(struct phy_device *phydev)
 	return 0;
 }
 
-struct phy_driver AR8021_driver =  {
+struct phy_driver AR8021_driver __phy_entry =  {
 	.name = "AR8021",
 	.uid = 0x4dd040,
 	.mask = 0xfffff0,
@@ -39,10 +39,3 @@ struct phy_driver AR8021_driver =  {
 	.startup = genphy_startup,
 	.shutdown = genphy_shutdown,
 };
-
-int phy_atheros_init(void)
-{
-	phy_register(&AR8021_driver);
-
-	return 0;
-}
drivers/net/phy/broadcom.c +3 -12
index 427ac60..513931d 100644
@@ -248,7 +248,7 @@ static int bcm5482_startup(struct phy_device *phydev)
 	return 0;
 }
 
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {
 	.name = "Broadcom BCM5461S",
 	.uid = 0x2060c0,
 	.mask = 0xfffff0,
@@ -258,7 +258,7 @@ static struct phy_driver BCM5461S_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver BCM5464S_driver = {
+struct phy_driver BCM5464S_driver __phy_entry = {
 	.name = "Broadcom BCM5464S",
 	.uid = 0x2060b0,
 	.mask = 0xfffff0,
@@ -268,7 +268,7 @@ static struct phy_driver BCM5464S_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver BCM5482S_driver = {
+struct phy_driver BCM5482S_driver __phy_entry = {
 	.name = "Broadcom BCM5482S",
 	.uid = 0x143bcb0,
 	.mask = 0xffffff0,
@@ -277,12 +277,3 @@ static struct phy_driver BCM5482S_driver = {
 	.startup = &bcm5482_startup,
 	.shutdown = &genphy_shutdown,
 };
-
-int phy_broadcom_init(void)
-{
-	phy_register(&BCM5482S_driver);
-	phy_register(&BCM5464S_driver);
-	phy_register(&BCM5461S_driver);
-
-	return 0;
-}
drivers/net/phy/davicom.c +1 -8
index e96a4af..1c61197 100644
@@ -80,7 +80,7 @@ static int dm9161_startup(struct phy_device *phydev)
 	return 0;
 }
 
-static struct phy_driver DM9161_driver = {
+struct phy_driver DM9161_driver __phy_entry = {
 	.name = "Davicom DM9161E",
 	.uid = 0x181b880,
 	.mask = 0xffffff0,
@@ -89,10 +89,3 @@ static struct phy_driver DM9161_driver = {
 	.startup = &dm9161_startup,
 	.shutdown = &genphy_shutdown,
 };
-
-int phy_davicom_init(void)
-{
-	phy_register(&DM9161_driver);
-
-	return 0;
-}
drivers/net/phy/lxt.c +1 -8
index d67bbdd..5b85616 100644
@@ -69,7 +69,7 @@ static int lxt971_startup(struct phy_device *phydev)
 	return 0;
 }
 
-static struct phy_driver LXT971_driver = {
+struct phy_driver LXT971_driver __phy_entry = {
 	.name = "LXT971",
 	.uid = 0x1378e0,
 	.mask = 0xfffff0,
@@ -78,10 +78,3 @@ static struct phy_driver LXT971_driver = {
 	.startup = &lxt971_startup,
 	.shutdown = &genphy_shutdown,
 };
-
-int phy_lxt_init(void)
-{
-	phy_register(&LXT971_driver);
-
-	return 0;
-}
drivers/net/phy/marvell.c +6 -18
index e51e799..90072cc 100644
@@ -395,7 +395,7 @@ static int m88e1149_config(struct phy_device *phydev)
 }
 
 
-static struct phy_driver M88E1011S_driver = {
+struct phy_driver M88E1011S_driver __phy_entry = {
 	.name = "Marvell 88E1011S",
 	.uid = 0x1410c60,
 	.mask = 0xffffff0,
@@ -405,7 +405,7 @@ static struct phy_driver M88E1011S_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver M88E1111S_driver = {
+struct phy_driver M88E1111S_driver __phy_entry = {
 	.name = "Marvell 88E1111S",
 	.uid = 0x1410cc0,
 	.mask = 0xffffff0,
@@ -415,7 +415,7 @@ static struct phy_driver M88E1111S_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver M88E1118_driver = {
+struct phy_driver M88E1118_driver __phy_entry = {
 	.name = "Marvell 88E1118",
 	.uid = 0x1410e10,
 	.mask = 0xffffff0,
@@ -425,7 +425,7 @@ static struct phy_driver M88E1118_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver M88E1121R_driver = {
+struct phy_driver M88E1121R_driver__phy_entry  = {
 	.name = "Marvell 88E1121R",
 	.uid = 0x1410cb0,
 	.mask = 0xffffff0,
@@ -435,7 +435,7 @@ static struct phy_driver M88E1121R_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver M88E1145_driver = {
+struct phy_driver M88E1145_driver __phy_entry = {
 	.name = "Marvell 88E1145",
 	.uid = 0x1410cd0,
 	.mask = 0xffffff0,
@@ -445,7 +445,7 @@ static struct phy_driver M88E1145_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver M88E1149S_driver = {
+struct phy_driver M88E1149S_driver __phy_entry = {
 	.name = "Marvell 88E1149S",
 	.uid = 0x1410ca0,
 	.mask = 0xffffff0,
@@ -454,15 +454,3 @@ static struct phy_driver M88E1149S_driver = {
 	.startup = &m88e1011s_startup,
 	.shutdown = &genphy_shutdown,
 };
-
-int phy_marvell_init(void)
-{
-	phy_register(&M88E1149S_driver);
-	phy_register(&M88E1145_driver);
-	phy_register(&M88E1121R_driver);
-	phy_register(&M88E1118_driver);
-	phy_register(&M88E1111S_driver);
-	phy_register(&M88E1011S_driver);
-
-	return 0;
-}
drivers/net/phy/micrel.c +2 -10
index d4e64f2..7508403 100644
@@ -22,7 +22,7 @@
  */
 #include <phy.h>
 
-static struct phy_driver KSZ804_driver = {
+struct phy_driver KSZ804_driver __phy_entry = {
 	.name = "Micrel KSZ804",
 	.uid = 0x221510,
 	.mask = 0xfffff0,
@@ -32,7 +32,7 @@ static struct phy_driver KSZ804_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver KS8721_driver = {
+struct phy_driver KS8721_driver __phy_entry = {
 	.name = "Micrel KS8721BL",
 	.uid = 0x221610,
 	.mask = 0xfffff0,
@@ -41,11 +41,3 @@ static struct phy_driver KS8721_driver = {
 	.startup = &genphy_startup,
 	.shutdown = &genphy_shutdown,
 };
-
-int phy_micrel_init(void)
-{
-	phy_register(&KSZ804_driver);
-	phy_register(&KS8721_driver);
-
-	return 0;
-}
drivers/net/phy/natsemi.c +1 -8
index ea60ac1..3829d74 100644
@@ -78,7 +78,7 @@ static int dp83865_startup(struct phy_device *phydev)
 }
 
 
-static struct phy_driver DP83865_driver = {
+struct phy_driver DP83865_driver __phy_entry = {
 	.name = "NatSemi DP83865",
 	.uid = 0x20005c70,
 	.mask = 0xfffffff0,
@@ -87,10 +87,3 @@ static struct phy_driver DP83865_driver = {
 	.startup = &dp83865_startup,
 	.shutdown = &genphy_shutdown,
 };
-
-int phy_natsemi_init(void)
-{
-	phy_register(&DP83865_driver);
-
-	return 0;
-}
drivers/net/phy/phy.c +5 -34
index eb55180..d3441c1 100644
@@ -420,40 +420,11 @@ static LIST_HEAD(phy_drivers);
 
 int phy_init(void)
 {
-#ifdef CONFIG_PHY_ATHEROS
-	phy_atheros_init();
-#endif
-#ifdef CONFIG_PHY_BROADCOM
-	phy_broadcom_init();
-#endif
-#ifdef CONFIG_PHY_DAVICOM
-	phy_davicom_init();
-#endif
-#ifdef CONFIG_PHY_LXT
-	phy_lxt_init();
-#endif
-#ifdef CONFIG_PHY_MARVELL
-	phy_marvell_init();
-#endif
-#ifdef CONFIG_PHY_MICREL
-	phy_micrel_init();
-#endif
-#ifdef CONFIG_PHY_NATSEMI
-	phy_natsemi_init();
-#endif
-#ifdef CONFIG_PHY_REALTEK
-	phy_realtek_init();
-#endif
-#ifdef CONFIG_PHY_SMSC
-	phy_smsc_init();
-#endif
-#ifdef CONFIG_PHY_TERANETICS
-	phy_teranetics_init();
-#endif
-#ifdef CONFIG_PHY_VITESSE
-	phy_vitesse_init();
-#endif
-
+	struct phy_driver *entry = &__phy_entry_start;
+	while (entry < &__phy_entry_end) {
+		phy_register(entry);
+		entry++;
+	}
 	return 0;
 }
 
drivers/net/phy/realtek.c +1 -8
index b7e2753..8733e38 100644
@@ -112,7 +112,7 @@ static int rtl8211b_startup(struct phy_device *phydev)
 	return 0;
 }
 
-static struct phy_driver RTL8211B_driver = {
+struct phy_driver RTL8211B_driver __phy_entry = {
 	.name = "RealTek RTL8211B",
 	.uid = 0x1cc910,
 	.mask = 0xfffff0,
@@ -121,10 +121,3 @@ static struct phy_driver RTL8211B_driver = {
 	.startup = &rtl8211b_startup,
 	.shutdown = &genphy_shutdown,
 };
-
-int phy_realtek_init(void)
-{
-	phy_register(&RTL8211B_driver);
-
-	return 0;
-}
drivers/net/phy/smsc.c +3 -12
index 6dee8eb..8bb4204 100644
@@ -52,7 +52,7 @@ static int smsc_startup(struct phy_device *phydev)
 	return 0;
 }
 
-static struct phy_driver lan8700_driver = {
+struct phy_driver lan8700_driver __phy_entry = {
 	.name = "SMSC LAN8700",
 	.uid = 0x0007c0c0,
 	.mask = 0xffff0,
@@ -62,7 +62,7 @@ static struct phy_driver lan8700_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver lan911x_driver = {
+struct phy_driver lan911x_driver __phy_entry = {
 	.name = "SMSC LAN911x Internal PHY",
 	.uid = 0x0007c0d0,
 	.mask = 0xffff0,
@@ -72,7 +72,7 @@ static struct phy_driver lan911x_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver lan8710_driver = {
+struct phy_driver lan8710_driver __phy_entry = {
 	.name = "SMSC LAN8710/LAN8720",
 	.uid = 0x0007c0f0,
 	.mask = 0xffff0,
@@ -81,12 +81,3 @@ static struct phy_driver lan8710_driver = {
 	.startup = &smsc_startup,
 	.shutdown = &genphy_shutdown,
 };
-
-int phy_smsc_init(void)
-{
-	phy_register(&lan8710_driver);
-	phy_register(&lan911x_driver);
-	phy_register(&lan8700_driver);
-
-	return 0;
-}
drivers/net/phy/teranetics.c +1 -8
index 78447b7..fd51355 100644
@@ -93,7 +93,7 @@ int tn2020_startup(struct phy_device *phydev)
 	return 0;
 }
 
-struct phy_driver tn2020_driver = {
+struct phy_driver tn2020_driver __phy_entry = {
 	.name = "Teranetics TN2020",
 	.uid = PHY_UID_TN2020,
 	.mask = 0xfffffff0,
@@ -105,10 +105,3 @@ struct phy_driver tn2020_driver = {
 	.startup = &tn2020_startup,
 	.shutdown = &gen10g_shutdown,
 };
-
-int phy_teranetics_init(void)
-{
-	phy_register(&tn2020_driver);
-
-	return 0;
-}
drivers/net/phy/vitesse.c +8 -22
index d48d4fe..15439aa 100644
@@ -146,7 +146,7 @@ int vsc8601_config(struct phy_device *phydev)
 	return 0;
 }
 
-static struct phy_driver VSC8211_driver = {
+struct phy_driver VSC8211_driver __phy_entry = {
 	.name	= "Vitesse VSC8211",
 	.uid	= 0xfc4b0,
 	.mask	= 0xffff0,
@@ -156,7 +156,7 @@ static struct phy_driver VSC8211_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver VSC8221_driver = {
+struct phy_driver VSC8221_driver __phy_entry = {
 	.name = "Vitesse VSC8221",
 	.uid = 0xfc550,
 	.mask = 0xffff0,
@@ -166,7 +166,7 @@ static struct phy_driver VSC8221_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver VSC8244_driver = {
+struct phy_driver VSC8244_driver __phy_entry = {
 	.name = "Vitesse VSC8244",
 	.uid = 0xfc6c0,
 	.mask = 0xffff0,
@@ -176,7 +176,7 @@ static struct phy_driver VSC8244_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver VSC8234_driver = {
+struct phy_driver VSC8234_driver __phy_entry = {
 	.name = "Vitesse VSC8234",
 	.uid = 0xfc620,
 	.mask = 0xffff0,
@@ -186,7 +186,7 @@ static struct phy_driver VSC8234_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver VSC8601_driver = {
+struct phy_driver VSC8601_driver __phy_entry = {
 	.name = "Vitesse VSC8601",
 	.uid = 0x70420,
 	.mask = 0xffff0,
@@ -196,7 +196,7 @@ static struct phy_driver VSC8601_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver VSC8641_driver = {
+struct phy_driver VSC8641_driver __phy_entry = {
 	.name = "Vitesse VSC8641",
 	.uid = 0x70430,
 	.mask = 0xffff0,
@@ -207,7 +207,7 @@ static struct phy_driver VSC8641_driver = {
 };
 
 /* Vitesse bought Cicada, so we'll put these here */
-static struct phy_driver cis8201_driver = {
+struct phy_driver cis8201_driver __phy_entry = {
 	.name = "CIS8201",
 	.uid = 0xfc410,
 	.mask = 0xffff0,
@@ -217,7 +217,7 @@ static struct phy_driver cis8201_driver = {
 	.shutdown = &genphy_shutdown,
 };
 
-static struct phy_driver cis8204_driver = {
+struct phy_driver cis8204_driver __phy_entry = {
 	.name = "Cicada Cis8204",
 	.uid = 0xfc440,
 	.mask = 0xffff0,
@@ -226,17 +226,3 @@ static struct phy_driver cis8204_driver = {
 	.startup = &vitesse_startup,
 	.shutdown = &genphy_shutdown,
 };
-
-int phy_vitesse_init(void)
-{
-	phy_register(&VSC8641_driver);
-	phy_register(&VSC8601_driver);
-	phy_register(&VSC8234_driver);
-	phy_register(&VSC8244_driver);
-	phy_register(&VSC8211_driver);
-	phy_register(&VSC8221_driver);
-	phy_register(&cis8201_driver);
-	phy_register(&cis8204_driver);
-
-	return 0;
-}
include/phy.h +3 -0
index bc522d5..e7a1ea7 100644
@@ -231,4 +231,7 @@ int phy_vitesse_init(void);
 /* PHY UIDs for various PHYs that are referenced in external code */
 #define PHY_UID_TN2020	0x00a19410
 
+#define __phy_entry  __attribute__((unused, section(".phy_entry"), aligned(4)))
+extern struct phy_driver __phy_entry_start, __phy_entry_end;
+
 #endif
u-boot-common.lds +7 -0
index e9a5fc9..db2e9ad 100644
@@ -5,6 +5,13 @@
 	}
 	__u_boot_cmd_end = .;
 
+	. = ALIGN(4);
+	__phy_entry_start = .;
+	.phy_entry : {
+		KEEP(*(.phy_entry))
+	}
+	__phy_entry_end = .;
+
 	/* powerpc specific, but harmless for others */
 	. = ALIGN(4);
 	__start___ex_table = .;
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 2/2 RFC: Let linker create phy array

drivers/net/phy/broadcom.c static int bcm5482_startup(struct phy_device *phydev) · line 251

Quoted 5 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:
drivers/net/phy/broadcom.c +1 -1
 
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ? that shouldn't affect the section name that it gets placed into.

include/phy.h int phy_vitesse_init(void); · line 235

Quoted 4 lines
include/phy.h +1 -0
 
+extern struct phy_driver __phy_entry_start, __phy_entry_end;

linker symbols should be declared like:

	extern char __phy_entry_start[];

u-boot-common.lds

Quoted 2 lines
u-boot-common.lds +0 -0

i'm not seeing this in the u-boot tree ...

u-boot-common.lds line 13

Quoted 6 lines
u-boot-common.lds +6 -0
+	. = ALIGN(4);
+	__phy_entry_start = .;
+	.phy_entry : {
+		KEEP(*(.phy_entry))
+	}
+	__phy_entry_end = .;

might have to introduce a helper macro like Linux's VMLINUX_SYMBOL() since some targets have a symbol prefix (like an underscore)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120204/ec278183/attachment.pgp>

#3 lore raw

PATCH 2/2 RFC: Let linker create phy array

Quoted 16 lines · Mike Frysinger

drivers/net/phy/broadcom.c

Quoted 5 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:
drivers/net/phy/broadcom.c +1 -1
 
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ? that shouldn't affect the section name that it gets placed into.

include/phy.h

Quoted 4 lines
include/phy.h +1 -0
 
+extern struct phy_driver __phy_entry_start, __phy_entry_end;

linker symbols should be declared like:

Quoted 6 lines
	extern char __phy_entry_start[];

u-boot-common.lds

Quoted 2 lines
u-boot-common.lds +0 -0

i'm not seeing this in the u-boot tree ...

u-boot-common.lds is created by patch 1/2 of this series which seems to not reached the list (due to the size?). Most probably it waits for moderator approval. I got this directly as I'm in CC. See below [1] for the essential parts.

Best regards

Dirk

[1]

[PATCH 1/2] RFC: create u-boot-common.lds

This makes adding linker defined tables easier
as far fewer lds files will need to be touched.

Series based on Stefano's u-boot-imx
Close inspection of

board/mousse/u-boot.lds.ram
arch/blackfin/cpu/u-boot.lds

is warranted.

./MAKEALL -a arm
Boards compiled: 216
Boards with warnings or errors: 71

---
  arch/arm/cpu/arm1136/u-boot.lds                  |    7 +------
  arch/arm/cpu/arm1176/u-boot.lds                  |    5 +----
  arch/arm/cpu/arm720t/u-boot.lds                  |    7 +------
  arch/arm/cpu/arm920t/ep93xx/u-boot.lds           |    5 +----
  arch/arm/cpu/arm920t/u-boot.lds                  |    7 +------
  arch/arm/cpu/arm925t/u-boot.lds                  |    7 +------
  arch/arm/cpu/arm926ejs/mx28/u-boot-spl.lds       |    5 +----
  arch/arm/cpu/arm926ejs/u-boot.lds                |    7 +------
  arch/arm/cpu/arm946es/u-boot.lds                 |    7 +------
  arch/arm/cpu/arm_intcm/u-boot.lds                |    7 +------
  arch/arm/cpu/armv7/u-boot.lds                    |    8 ++------
  arch/arm/cpu/ixp/u-boot.lds                      |    7 +------
  arch/arm/cpu/lh7a40x/u-boot.lds                  |    7 +------
  arch/arm/cpu/pxa/u-boot.lds                      |    7 +------
  arch/arm/cpu/s3c44b0/u-boot.lds                  |    7 +------
  arch/arm/cpu/sa1100/u-boot.lds                   |    7 +------
  arch/avr32/cpu/u-boot.lds                        |    8 +-------
  arch/blackfin/cpu/u-boot.lds                     |   15 ++++++---------
  arch/nds32/cpu/n1213/u-boot.lds                  |    5 +----
  arch/nios2/cpu/u-boot.lds                        |    8 ++------
  arch/powerpc/cpu/74xx_7xx/u-boot.lds             |   11 +----------
  arch/powerpc/cpu/mpc512x/u-boot.lds              |   11 +----------
  arch/powerpc/cpu/mpc5xx/u-boot.lds               |   11 +----------
  arch/powerpc/cpu/mpc5xxx/u-boot-customlayout.lds |   11 +----------
  arch/powerpc/cpu/mpc5xxx/u-boot.lds              |   11 +----------
  arch/powerpc/cpu/mpc8220/u-boot.lds              |   11 +----------
  arch/powerpc/cpu/mpc824x/u-boot.lds              |   11 +----------
  arch/powerpc/cpu/mpc8260/u-boot.lds              |   11 +----------
  arch/powerpc/cpu/mpc83xx/u-boot.lds              |   11 +----------
  arch/powerpc/cpu/mpc85xx/u-boot-nand.lds         |   10 +---------
  arch/powerpc/cpu/mpc85xx/u-boot.lds              |   10 +---------
  arch/powerpc/cpu/mpc86xx/u-boot.lds              |   10 +---------
  arch/powerpc/cpu/ppc4xx/u-boot.lds               |   10 +---------
  arch/sandbox/cpu/u-boot.lds                      |    4 +---
  arch/sh/cpu/sh2/u-boot.lds                       |    9 ++-------
  arch/sh/cpu/sh3/u-boot.lds                       |   10 +++-------
  arch/sh/cpu/sh4/u-boot.lds                       |    9 ++-------
  arch/x86/cpu/u-boot.lds                          |    6 +-----
  board/BuS/EB+MCF-EV123/u-boot.lds                |   10 +---------
  board/LEOX/elpt860/u-boot.lds                    |   10 +---------
  board/LEOX/elpt860/u-boot.lds.debug              |    4 +---
  board/RPXClassic/u-boot.lds                      |   11 +----------
  board/RPXClassic/u-boot.lds.debug                |    9 +--------
  board/RPXlite/u-boot.lds                         |   11 +----------
  board/RPXlite/u-boot.lds.debug                   |    9 +--------
  board/RPXlite_dw/u-boot.lds                      |   11 +----------
  board/RPXlite_dw/u-boot.lds.debug                |    9 +--------
  board/RRvision/u-boot.lds                        |   11 +----------
  board/actux1/u-boot.lds                          |    8 ++------
  board/actux2/u-boot.lds                          |    8 ++------
  board/actux3/u-boot.lds                          |    8 ++------
  board/adder/u-boot.lds                           |   11 +----------
  board/altera/nios2-generic/u-boot.lds            |    8 ++------
  board/amcc/acadia/u-boot-nand.lds                |   11 +----------
  board/amcc/bamboo/u-boot-nand.lds                |   11 +----------
  board/amcc/canyonlands/u-boot-nand.lds           |   11 +----------
  board/amcc/kilauea/u-boot-nand.lds               |   11 +----------
  board/amcc/sequoia/u-boot-nand.lds               |   11 +----------
  board/amcc/sequoia/u-boot-ram.lds                |   11 +----------
  board/amirix/ap1000/u-boot.lds                   |    9 +--------
  board/astro/mcf5373l/u-boot.lds                  |   11 +----------
  board/c2mon/u-boot.lds                           |   11 +----------
  board/c2mon/u-boot.lds.debug                     |    9 +--------
  board/cobra5272/u-boot.lds                       |   10 +---------
  board/cogent/u-boot.lds                          |   11 +----------
  board/cogent/u-boot.lds.debug                    |    9 +--------
  board/cray/L1/u-boot.lds.debug                   |    9 +--------
  board/dave/PPChameleonEVB/u-boot.lds             |   10 +---------
  board/dbau1x00/u-boot.lds                        |    6 +-----
  board/dvlhost/u-boot.lds                         |    8 ++------
  board/eltec/mhpc/u-boot.lds                      |   11 +----------
  board/eltec/mhpc/u-boot.lds.debug                |    9 +--------
  board/emk/top860/u-boot.lds                      |   12 +-----------
  board/emk/top860/u-boot.lds.debug                |    4 +---
  board/ep88x/u-boot.lds                           |   11 +----------
  board/esd/dasa_sim/u-boot.lds                    |   11 +----------
  board/esd/pmc440/u-boot-nand.lds                 |   11 +----------
  board/esd/tasreg/u-boot.lds                      |   10 +---------
  board/esteem192e/u-boot.lds                      |   11 +----------
  board/etx094/u-boot.lds                          |   11 +----------
  board/evb64260/u-boot.lds                        |   11 +----------
  board/fads/u-boot.lds                            |   11 +----------
  board/flagadm/u-boot.lds                         |   11 +----------
  board/flagadm/u-boot.lds.debug                   |    9 +--------
  board/freescale/m5208evbe/u-boot.lds             |   10 +---------
  board/freescale/m52277evb/u-boot.lds             |   10 +---------
  board/freescale/m5235evb/u-boot.lds              |   10 +---------
  board/freescale/m5249evb/u-boot.lds              |   10 +---------
  board/freescale/m5253demo/u-boot.lds             |   10 +---------
  board/freescale/m5253evbe/u-boot.lds             |   10 +---------
  board/freescale/m5271evb/u-boot.lds              |   10 +---------
  board/freescale/m5272c3/u-boot.lds               |   10 +---------
  board/freescale/m5275evb/u-boot.lds              |   10 +---------
  board/freescale/m5282evb/u-boot.lds              |   10 +---------
  board/freescale/m53017evb/u-boot.lds             |   10 +---------
  board/freescale/m5329evb/u-boot.lds              |   10 +---------
  board/freescale/m5373evb/u-boot.lds              |   10 +---------
  board/freescale/m54451evb/u-boot.lds             |   10 +---------
  board/freescale/m54455evb/u-boot.lds             |   10 +---------
  board/freescale/m547xevb/u-boot.lds              |   10 +---------
  board/freescale/m548xevb/u-boot.lds              |   10 +---------
  board/freescale/mx31ads/u-boot.lds               |    5 +----
  board/gaisler/gr_cpci_ax2000/u-boot.lds          |    6 +-----
  board/gaisler/gr_ep2s60/u-boot.lds               |    6 +-----
  board/gaisler/gr_xc3s_1500/u-boot.lds            |    6 +-----
  board/gaisler/grsim/u-boot.lds                   |    6 +-----
  board/gaisler/grsim_leon2/u-boot.lds             |    6 +-----
  board/gen860t/u-boot-flashenv.lds                |   10 +---------
  board/gen860t/u-boot.lds                         |   11 +----------
  board/genietv/u-boot.lds                         |   11 +----------
  board/genietv/u-boot.lds.debug                   |    9 +--------
  board/gth2/u-boot.lds                            |    6 +-----
  board/hermes/u-boot.lds                          |   11 +----------
  board/hermes/u-boot.lds.debug                    |    9 +--------
  board/hymod/u-boot.lds                           |   11 +----------
  board/hymod/u-boot.lds.debug                     |    9 +--------
  board/icu862/u-boot.lds                          |   11 +----------
  board/icu862/u-boot.lds.debug                    |    9 +--------
  board/idmr/u-boot.lds                            |   10 +---------
  board/incaip/u-boot.lds                          |    6 +-----
  board/ip860/u-boot.lds                           |   11 +----------
  board/ip860/u-boot.lds.debug                     |    9 +--------
  board/ivm/u-boot.lds                             |   11 +----------
  board/ivm/u-boot.lds.debug                       |    9 +--------
  board/jornada/u-boot.lds                         |    6 +-----
  board/korat/u-boot-F7FC.lds                      |   11 +----------
  board/kup/kup4k/u-boot.lds                       |   11 +----------
  board/kup/kup4k/u-boot.lds.debug                 |    9 +--------
  board/kup/kup4x/u-boot.lds                       |   11 +----------
  board/kup/kup4x/u-boot.lds.debug                 |    9 +--------
  board/lantec/u-boot.lds                          |   11 +----------
  board/lantec/u-boot.lds.debug                    |    9 +--------
  board/lwmon/u-boot.lds                           |   11 +----------
  board/lwmon/u-boot.lds.debug                     |    9 +--------
  board/manroland/uc100/u-boot.lds                 |   11 +----------
  board/matrix_vision/mvsmr/u-boot.lds             |   11 +----------
  board/mbx8xx/u-boot.lds                          |   11 +----------
  board/mbx8xx/u-boot.lds.debug                    |    9 +--------
  board/micronas/vct/u-boot.lds                    |    7 +------
  board/ml2/u-boot.lds                             |   11 +----------
  board/ml2/u-boot.lds.debug                       |    9 +--------
  board/mousse/u-boot.lds                          |   11 +----------
  board/mousse/u-boot.lds.ram                      |    9 +--------
  board/mousse/u-boot.lds.rom                      |    8 +-------
  board/mpl/pip405/u-boot.lds.debug                |    9 +--------
  board/mvblue/u-boot.lds                          |   11 +----------
  board/netphone/u-boot.lds                        |   11 +----------
  board/netphone/u-boot.lds.debug                  |    9 +--------
  board/netta/u-boot.lds                           |   11 +----------
  board/netta/u-boot.lds.debug                     |    9 +--------
  board/netta2/u-boot.lds                          |   11 +----------
  board/netta2/u-boot.lds.debug                    |    9 +--------
  board/netvia/u-boot.lds                          |   11 +----------
  board/netvia/u-boot.lds.debug                    |    9 +--------
  board/nx823/u-boot.lds                           |   11 +----------
  board/nx823/u-boot.lds.debug                     |    9 +--------
  board/openrisc/openrisc-generic/u-boot.lds       |    4 +---
  board/pb1x00/u-boot.lds                          |    6 +-----
  board/qemu-mips/u-boot.lds                       |    7 +------
  board/qi/qi_lb60/u-boot.lds                      |    4 +---
  board/quantum/u-boot.lds                         |   11 +----------
  board/quantum/u-boot.lds.debug                   |    4 +---
  board/r360mpi/u-boot.lds                         |   11 +----------
  board/rbc823/u-boot.lds                          |   10 +---------
  board/renesas/sh7757lcr/u-boot.lds               |   10 +++-------
  board/rsdproto/u-boot.lds                        |   11 +----------
  board/samsung/smdk6400/u-boot-nand.lds           |    4 +---
  board/sandburst/karef/u-boot.lds.debug           |    9 +--------
  board/sandburst/metrobox/u-boot.lds.debug        |    9 +--------
  board/sandpoint/u-boot.lds                       |   11 +----------
  board/siemens/IAD210/u-boot.lds                  |   11 +----------
  board/sixnet/u-boot.lds                          |   11 +----------
  board/snmc/qs850/u-boot.lds                      |   11 +----------
  board/snmc/qs860t/u-boot.lds                     |   11 +----------
  board/spc1920/u-boot.lds                         |   11 +----------
  board/spd8xx/u-boot.lds                          |   11 +----------
  board/spd8xx/u-boot.lds.debug                    |    9 +--------
  board/stx/stxxtc/u-boot.lds                      |   11 +----------
  board/stx/stxxtc/u-boot.lds.debug                |    9 +--------
  board/svm_sc8xx/u-boot.lds                       |   11 +----------
  board/svm_sc8xx/u-boot.lds.debug                 |    4 +---
  board/tqc/tqm8xx/u-boot.lds                      |   11 +----------
  board/v37/u-boot.lds                             |   11 +----------
  board/w7o/u-boot.lds.debug                       |    9 +--------
  board/westel/amx860/u-boot.lds                   |   11 +----------
  board/westel/amx860/u-boot.lds.debug             |    9 +--------
  board/xes/xpedite1000/u-boot.lds.debug           |    9 +--------
  board/xilinx/microblaze-generic/u-boot.lds       |    8 +-------
  board/zipitz2/u-boot.lds                         |    5 +----
  doc/README.commands                              |    5 +++++
  nand_spl/board/freescale/mx31pdk/Makefile        |    2 +-
  nand_spl/board/freescale/mx31pdk/u-boot.lds      |    5 +----
  nand_spl/board/karo/tx25/Makefile                |    2 +-
  nand_spl/board/karo/tx25/u-boot.lds              |    5 +----
  nand_spl/board/samsung/smdk6400/Makefile         |    2 +-
  nand_spl/board/samsung/smdk6400/u-boot.lds       |    4 +---
  spl/Makefile                                     |    3 ++-
  u-boot-common.lds                                |   14 ++++++++++++++
  198 files changed, 234 insertions(+), 1554 deletions(-)

create mode 100644 u-boot-common.lds

(quoted diff) +0 -0

b/arch/arm/cpu/arm1136/u-boot.lds
index d1e2851..cd7927c 100644

arch/arm/cpu/arm1136/u-boot.lds +1 -6
@@ -52,12 +52,7 @@ SECTIONS
  		*(.data)
  	}
 
-	. = ALIGN(4);
-
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
  	. = ALIGN(4);
 
(quoted diff) +0 -0

b/arch/arm/cpu/arm1176/u-boot.lds
index 27d6638..9852b0a 100644

arch/arm/cpu/arm1176/u-boot.lds +1 -4
@@ -43,10 +43,7 @@ SECTIONS
  		*(.data)
  	}
 
-	. = .;
-	__u_boot_cmd_start = .;
-	.u_boot_cmd : { *(.u_boot_cmd) }
-	__u_boot_cmd_end = .;
+	INCLUDE u-boot-common.lds
 
  	. = ALIGN(4);

...

u-boot-common.lds new file +14 -0
new file mode 100644
index 0000000..e9a5fc9
@@ -0,0 +1,14 @@
+	. = ALIGN(4);
+	__u_boot_cmd_start = .;
+	.u_boot_cmd : {
+		KEEP(*(.u_boot_cmd))
+	}
+	__u_boot_cmd_end = .;
+
+	/* powerpc specific, but harmless for others */
+	. = ALIGN(4);
+	__start___ex_table = .;
+	__ex_table : {
+		KEEP(*(__ex_table))
+	}
+	__stop___ex_table = .;
#4 lore raw

PATCH 2/2 RFC: Let linker create phy array

In reply to Mike Frysinger

Hi Mike,

Le 05/02/2012 04:38, Mike Frysinger a ?crit :

Quoted 10 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:

drivers/net/phy/broadcom.c static int bcm5482_startup(struct phy_device *phydev) · line 251

Quoted 5 lines
drivers/net/phy/broadcom.c +1 -1
 
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ? that shouldn't affect the section name that it gets placed into.

Quoted 7 lines

include/phy.h int phy_vitesse_init(void); · line 235

Quoted 4 lines
include/phy.h +1 -0
 
+extern struct phy_driver __phy_entry_start, __phy_entry_end;

linker symbols should be declared like:

	extern char __phy_entry_start[];

Why should they?

Amicalement,

Signature · 1 line
Albert.
#5 lore raw

PATCH 2/2 RFC: Let linker create phy array

Quoted 11 lines · On Sunday 05 February 2012 08:26:57 Albert ARIBAUD wrote:

Le 05/02/2012 04:38, Mike Frysinger a ?crit :

Quoted 8 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:

include/phy.h int phy_vitesse_init(void); · line 235

Quoted 4 lines
include/phy.h +1 -0
 
+extern struct phy_driver __phy_entry_start, __phy_entry_end;

linker symbols should be declared like:

	extern char __phy_entry_start[];

Why should they?

because that's what the GNU linker documentation says to, and that's how all existing symbols have been handled. look at asm/sections.h in every Linux arch.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120205/398a3e01/attachment.pgp>

#6 lore raw

PATCH 2/2 RFC: Let linker create phy array

Le 05/02/2012 21:40, Mike Frysinger a ?crit :

Quoted 11 lines · On Sunday 05 February 2012 08:26:57 Albert ARIBAUD wrote:
Quoted 10 lines

Le 05/02/2012 04:38, Mike Frysinger a ?crit :

Quoted 8 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:

include/phy.h int phy_vitesse_init(void); · line 235

Quoted 4 lines
include/phy.h +1 -0
 
+extern struct phy_driver __phy_entry_start, __phy_entry_end;

linker symbols should be declared like:

	extern char __phy_entry_start[];
Quoted 5 lines
Quoted 1 line

Why should they?

because that's what the GNU linker documentation says to, and that's how all existing symbols have been handled. look at asm/sections.h in every Linux arch.

Does it? What I read from
<http://sourceware.org/binutils/docs-2.22/ld/Source-Code-Reference.html#Source-Code-Reference>
never says that linker-defined symbols should be declared in source code as char[]; actually, it gives examples where linker-defined symbols are defined with types int and char, not char[].

What the section says, OTOH, is that one must remember that the linker will not allocate space for a symbol unless explicitly instructed to, so such symbols my not have meaningful values, only addresses, and the code should access these symbols by address -- which is what is being done in the code of the RFC patch IIUC.

Quoted 1 line

-mike

Amicalement,

Signature · 1 line
Albert.
author
#7 lore raw

PATCH 2/2 RFC: Let linker create phy array

In reply to Mike Frysinger
Quoted 8 lines · Mike Frysinger

drivers/net/phy/broadcom.c static int bcm5482_startup(struct phy_device *phydev) · line 251

Quoted 5 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:
drivers/net/phy/broadcom.c +1 -1
 
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ? that shouldn't affect the section name that it gets placed into.

I had static to start. But the compiler ate all of the code. No references to any of the static symbols.

Quoted 7 lines

include/phy.h int phy_vitesse_init(void); · line 235

Quoted 5 lines
include/phy.h +1 -0
 
+extern struct phy_driver __phy_entry_start, __phy_entry_end;

linker symbols should be declared like:

	extern char __phy_entry_start[];

Why char ?

Quoted 11 lines

include/phy.h

Quoted 8 lines
include/phy.h +6 -0
+	. = ALIGN(4);
+	__phy_entry_start = .;
+	.phy_entry : {
+		KEEP(*(.phy_entry))
+	}
+	__phy_entry_end = .;

might have to introduce a helper macro like Linux's VMLINUX_SYMBOL() since some targets have a symbol prefix (like an underscore)
-mike

Hmmm. Your right,
grep ___u_boot_cmd_start 0001-RFC-create-u-boot-common.lds.patch

finds that arch/blackfin/cpu/u-boot.lds has an extra "_"

Thanks for pointing it out.

Troy

#8 lore raw

PATCH 2/2 RFC: Let linker create phy array

Quoted 5 lines · On Monday 06 February 2012 13:48:13 Troy Kisky wrote:
Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:
drivers/net/phy/broadcom.c +0 -0
Quoted 8 lines
Quoted 5 lines

drivers/net/phy/broadcom.c static int bcm5482_startup(struct phy_device *phydev) · line 251

Quoted 2 lines
drivers/net/phy/broadcom.c +1 -1
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ? that shouldn't affect the section name that it gets placed into.

I had static to start. But the compiler ate all of the code. No references to any of the static symbols.

sounds like you should change the __phy_entry define from "unused" to "used" -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120206/abbcedb8/attachment.pgp>

author
#9 lore raw

PATCH 2/2 RFC: Let linker create phy array

Quoted 6 lines · Mike Frysinger
Quoted 5 lines · On Monday 06 February 2012 13:48:13 Troy Kisky wrote:
Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:
drivers/net/phy/broadcom.c +0 -0
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

drivers/net/phy/broadcom.c static int bcm5482_startup(struct phy_device *phydev) · line 251

Quoted 2 lines
drivers/net/phy/broadcom.c +1 -1
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ? that shouldn't affect the section name that it gets placed into.

I had static to start. But the compiler ate all of the code. No references to any of the static symbols.

sounds like you should change the __phy_entry define from "unused" to "used" -mike

The would give me compiler warnings for unused variables. How does that help?
Is there a keep attribute like the linker has for sections?

Troy

#10 lore raw

PATCH 2/2 RFC: Let linker create phy array

Le 06/02/2012 21:17, Troy Kisky a ?crit :

Quoted 12 lines · Mike Frysinger
Quoted 11 lines · On Monday 06 February 2012 13:48:13 Troy Kisky wrote:
Quoted 10 lines · Mike Frysinger
Quoted 9 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:

drivers/net/phy/broadcom.c static int bcm5482_startup(struct phy_device *phydev) · line 251

Quoted 5 lines
drivers/net/phy/broadcom.c +1 -1
 
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ? that shouldn't affect the section
name that it gets placed into.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I had static to start. But the compiler ate all of the code. No references to any of the static symbols.

sounds like you should change the __phy_entry define from "unused" to "used"
-mike

The would give me compiler warnings for unused variables. How does that help?
Is there a keep attribute like the linker has for sections?

No, but indeed not keeping the 'static' keyword has this effect: the object file will keep the phy struct, in case it is referred to by another object file at link time.

Quoted 1 line

Troy

Amicalement,

Signature · 1 line
Albert.
#11 lore raw

PATCH 2/2 RFC: Let linker create phy array

In reply to Troy Kisky
Quoted 13 lines · On Monday 06 February 2012 15:17:32 Troy Kisky wrote:
Quoted 12 lines · Mike Frysinger
Quoted 11 lines · On Monday 06 February 2012 13:48:13 Troy Kisky wrote:
Quoted 9 lines · Mike Frysinger

drivers/net/phy/broadcom.c static int bcm5482_startup(struct phy_device *phydev) · line 251

Quoted 5 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:
drivers/net/phy/broadcom.c +1 -1
 
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ? that shouldn't affect the section name that it gets placed into.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I had static to start. But the compiler ate all of the code. No references to any of the static symbols.

sounds like you should change the __phy_entry define from "unused" to "used"

The would give me compiler warnings for unused variables. How does that help?

does gcc issue warnings ? doesn't seem to do so for me.

Quoted 1 line

Is there a keep attribute like the linker has for sections?

yes, __attribute__((used))
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120206/e716900a/attachment.pgp>

#12 lore raw

PATCH 2/2 RFC: Let linker create phy array

Le 06/02/2012 21:57, Mike Frysinger a ?crit :

Quoted 4 lines
Quoted 2 lines

The would give me compiler warnings for unused variables. How does that help?

does gcc issue warnings ? doesn't seem to do so for me.

Some do, and some will.

Quoted 3 lines
Quoted 1 line

Is there a keep attribute like the linker has for sections?

yes, __attribute__((used))

What is the point in adding a 'static' qualifier and a ((used)) attribute, when not adding them in the first place gives the same result?

Amicalement,

Signature · 1 line
Albert.
#13 lore raw

PATCH 2/2 RFC: Let linker create phy array

Quoted 7 lines · On Monday 06 February 2012 16:01:56 Albert ARIBAUD wrote:

Le 06/02/2012 21:57, Mike Frysinger a ?crit :

Quoted 4 lines
Quoted 2 lines

The would give me compiler warnings for unused variables. How does that help?

does gcc issue warnings ? doesn't seem to do so for me.

Some do, and some will.

vague ... be nice to have actual examples

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Is there a keep attribute like the linker has for sections?

yes, __attribute__((used))

What is the point in adding a 'static' qualifier and a ((used)) attribute, when not adding them in the first place gives the same result?

to control the visibility
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120207/4ab1183e/attachment.pgp>

#14 lore raw

PATCH 2/2 RFC: Let linker create phy array

Le 07/02/2012 16:20, Mike Frysinger a ?crit :

Quoted 11 lines · On Monday 06 February 2012 16:01:56 Albert ARIBAUD wrote:
Quoted 7 lines

Le 06/02/2012 21:57, Mike Frysinger a ?crit :

Quoted 4 lines
Quoted 2 lines

The would give me compiler warnings for unused variables. How does that help?

does gcc issue warnings ? doesn't seem to do so for me.

Some do, and some will.

vague ... be nice to have actual examples

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Is there a keep attribute like the linker has for sections?

yes, __attribute__((used))

What is the point in adding a 'static' qualifier and a ((used)) attribute, when not adding them in the first place gives the same result?

to control the visibility

I don't understand what you mean with this. Can you please elaborate?

Quoted 1 line

-mike

Amicalement,

Signature · 1 line
Albert.
#15 lore raw

PATCH 2/2 RFC: Let linker create phy array

Quoted 7 lines · On Friday 10 February 2012 14:39:12 Albert ARIBAUD wrote:

Le 07/02/2012 16:20, Mike Frysinger a ?crit :

Quoted 6 lines · On Monday 06 February 2012 16:01:56 Albert ARIBAUD wrote:
Quoted 5 lines

Le 06/02/2012 21:57, Mike Frysinger a ?crit :

Quoted 3 lines
Quoted 1 line

Is there a keep attribute like the linker has for sections?

yes, __attribute__((used))

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

What is the point in adding a 'static' qualifier and a ((used)) attribute, when not adding them in the first place gives the same result?

to control the visibility

I don't understand what you mean with this. Can you please elaborate?

no static means it has global elf visibility (other .c files can "extern" it, and you have to worry about symbol clashes):

$ gcc -x c -c - -o test.o <<<'int foo;' && readelf -s test.o | grep foo
     7: 0000000000000004     4 OBJECT  GLOBAL DEFAULT  COM foo

static means it has local elf visibility (other files don't get access, and you don't have to worry about symbol clashes):

$ gcc -x c -c - -o test.o <<<'static int foo;' && readelf -s test.o | grep foo
     5: 0000000000000000     4 OBJECT  LOCAL  DEFAULT    3 foo

imo, anything that should not be externally accessed should have "static". this is just good programming practice.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120210/95be4542/attachment.pgp>

#16 lore raw

PATCH 2/2 RFC: Let linker create phy array

Le 10/02/2012 21:32, Mike Frysinger a ?crit :

Quoted 21 lines · On Friday 10 February 2012 14:39:12 Albert ARIBAUD wrote:
Quoted 7 lines

Le 07/02/2012 16:20, Mike Frysinger a ?crit :

Quoted 6 lines · On Monday 06 February 2012 16:01:56 Albert ARIBAUD wrote:
Quoted 5 lines

Le 06/02/2012 21:57, Mike Frysinger a ?crit :

Quoted 3 lines
Quoted 1 line

Is there a keep attribute like the linker has for sections?

yes, __attribute__((used))

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

What is the point in adding a 'static' qualifier and a ((used)) attribute, when not adding them in the first place gives the same result?

to control the visibility

I don't understand what you mean with this. Can you please elaborate?

no static means it has global elf visibility (other .c files can "extern" it, and you have to worry about symbol clashes):

$ gcc -x c -c - -o test.o<<<'int foo;'&&  readelf -s test.o | grep foo
      7: 0000000000000004     4 OBJECT  GLOBAL DEFAULT  COM foo
Quoted 7 lines

static means it has local elf visibility (other files don't get access, and you don't have to worry about symbol clashes):

$ gcc -x c -c - -o test.o<<<'static int foo;'&&  readelf -s test.o | grep foo
      5: 0000000000000000     4 OBJECT  LOCAL  DEFAULT    3 foo

imo, anything that should not be externally accessed should have "static". this is just good programming practice.

I would agree 100% if the symbol was truly local, i.e. declared *and used* locally. Here, however, it is used globally, by being gathered in a global section to serve as an entry in a global array.

The only interest of making the symbol static would indeed be to allow reusing the symbol name elsewhere, which I think is quite improbable considering the symbol was global so far.

So we add the static qualifier despite the object actually not being static; and because the object is not actually static, that qualifier causes a legit diagnostic; and to eliminate that diagnostic, we add an 'unused' attribute. This I find less than good programming practice.

Quoted 1 line

-mike

Amicalement,

Signature · 1 line
Albert.
#17 lore raw

PATCH 2/2 RFC: Let linker create phy array

Quoted 28 lines · On Friday 10 February 2012 15:57:50 Albert ARIBAUD wrote:

Le 10/02/2012 21:32, Mike Frysinger a ?crit :

Quoted 27 lines · On Friday 10 February 2012 14:39:12 Albert ARIBAUD wrote:
Quoted 7 lines

Le 07/02/2012 16:20, Mike Frysinger a ?crit :

Quoted 6 lines · On Monday 06 February 2012 16:01:56 Albert ARIBAUD wrote:
Quoted 5 lines

Le 06/02/2012 21:57, Mike Frysinger a ?crit :

Quoted 3 lines
Quoted 1 line

Is there a keep attribute like the linker has for sections?

yes, __attribute__((used))

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

What is the point in adding a 'static' qualifier and a ((used)) attribute, when not adding them in the first place gives the same result?

to control the visibility

I don't understand what you mean with this. Can you please elaborate?

no static means it has global elf visibility (other .c files can "extern" it, and you have to worry about symbol clashes):

$ gcc -x c -c - -o test.o<<<'int foo;'&&  readelf -s test.o | grep foo
      7: 0000000000000004     4 OBJECT  GLOBAL DEFAULT  COM foo

static means it has local elf visibility (other files don't get access, and you don't have to worry about symbol clashes):

$ gcc -x c -c - -o test.o<<<'static int foo;'&&  readelf -s test.o | grep
foo
Quoted 8 lines
Quoted 4 lines
      5: 0000000000000000     4 OBJECT  LOCAL  DEFAULT    3 foo

imo, anything that should not be externally accessed should have "static". this is just good programming practice.

I would agree 100% if the symbol was truly local, i.e. declared *and used* locally. Here, however, it is used globally, by being gathered in a global section to serve as an entry in a global array.

except access is now explicitly gated, and symbol collisions are still prevented

Quoted 3 lines

The only interest of making the symbol static would indeed be to allow reusing the symbol name elsewhere, which I think is quite improbable considering the symbol was global so far.

one or two might be global, but for the most part, they were all local. look at his patch ... he deletes the "static" keyword in many places.

this style i'm proposing has been used in the kernel in subsystems, and some of them end up using the same variable name in diff modules. like crypto/ which uses "alg" as the name for all of its shash drivers.

Quoted 4 lines

So we add the static qualifier despite the object actually not being static; and because the object is not actually static, that qualifier causes a legit diagnostic; and to eliminate that diagnostic, we add an 'unused' attribute. This I find less than good programming practice.

no, the unused attribute was added *after* removing "static". i'm proposing adding "used" so gcc won't strip it regardless of what else happens while retaining all other benefits that "static" brings us.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120210/0130816d/attachment.pgp>

#18 lore raw

PATCH 2/2 RFC: Let linker create phy array

Le 10/02/2012 22:41, Mike Frysinger a ?crit :

Quoted 41 lines · On Friday 10 February 2012 15:57:50 Albert ARIBAUD wrote:
Quoted 28 lines

Le 10/02/2012 21:32, Mike Frysinger a ?crit :

Quoted 27 lines · On Friday 10 February 2012 14:39:12 Albert ARIBAUD wrote:
Quoted 7 lines

Le 07/02/2012 16:20, Mike Frysinger a ?crit :

Quoted 6 lines · On Monday 06 February 2012 16:01:56 Albert ARIBAUD wrote:
Quoted 5 lines

Le 06/02/2012 21:57, Mike Frysinger a ?crit :

Quoted 3 lines
Quoted 1 line

Is there a keep attribute like the linker has for sections?

yes, __attribute__((used))

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

What is the point in adding a 'static' qualifier and a ((used)) attribute, when not adding them in the first place gives the same result?

to control the visibility

I don't understand what you mean with this. Can you please elaborate?

no static means it has global elf visibility (other .c files can "extern" it, and you have to worry about symbol clashes):

$ gcc -x c -c - -o test.o<<<'int foo;'&&   readelf -s test.o | grep foo
       7: 0000000000000004     4 OBJECT  GLOBAL DEFAULT  COM foo

static means it has local elf visibility (other files don't get access, and you don't have to worry about symbol clashes):

$ gcc -x c -c - -o test.o<<<'static int foo;'&&   readelf -s test.o | grep
foo
Quoted 8 lines
Quoted 4 lines
       5: 0000000000000000     4 OBJECT  LOCAL  DEFAULT    3 foo

imo, anything that should not be externally accessed should have "static". this is just good programming practice.

I would agree 100% if the symbol was truly local, i.e. declared *and used* locally. Here, however, it is used globally, by being gathered in a global section to serve as an entry in a global array.

except access is now explicitly gated, and symbol collisions are still prevented

Quoted 6 lines
Quoted 3 lines

The only interest of making the symbol static would indeed be to allow reusing the symbol name elsewhere, which I think is quite improbable considering the symbol was global so far.

one or two might be global, but for the most part, they were all local. look at his patch ... he deletes the "static" keyword in many places.

"Were" is precisely the point. They were indeed proper locals before the patch. With it, they are not any more -- they are not used locally, they are used globally.

Quoted 4 lines

this style i'm proposing has been used in the kernel in subsystems, and some of them end up using the same variable name in diff modules. like crypto/ which uses "alg" as the name for all of its shash drivers.

Quoted 8 lines
Quoted 4 lines

So we add the static qualifier despite the object actually not being static; and because the object is not actually static, that qualifier causes a legit diagnostic; and to eliminate that diagnostic, we add an 'unused' attribute. This I find less than good programming practice.

no, the unused attribute was added *after* removing "static". i'm proposing adding "used" so gcc won't strip it regardless of what else happens while retaining all other benefits that "static" brings us.

Correct, but it does not change my overall point that there is no point in adding a qualifier and an attribute to avoid name collisions that do not actually happen in the first place and that we can easily avoid by simply giving meaningful names to each of theses structs -- a practice which, again, is currently and successfully applied.

Plus, having globals is a good thing, because we can put names, so to speak, in the map file on what was collected in the section, whereas with statics, the section would just be just a black box and, were we to check if such entry was actually put in it, we would have to dig in the source code and build system.

Quoted 1 line

-mike

Amicalement,

Signature · 1 line
Albert.
author
#19 lore raw

PATCH 2/2 RFC: Let linker create phy array

In reply to Mike Frysinger
Quoted 16 lines · Mike Frysinger
Quoted 15 lines · On Monday 06 February 2012 15:17:32 Troy Kisky wrote:
Quoted 14 lines · Mike Frysinger
Quoted 11 lines · On Monday 06 February 2012 13:48:13 Troy Kisky wrote:
Quoted 8 lines · Mike Frysinger

drivers/net/phy/broadcom.c static int bcm5482_startup(struct phy_device *phydev) · line 251

Quoted 5 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:
drivers/net/phy/broadcom.c +1 -1
 
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ? that shouldn't affect the section name that it gets placed into.

I had static to start. But the compiler ate all of the code. No references to any of the static symbols.

sounds like you should change the __phy_entry define from "unused" to "used"

Quoted 7 lines
Quoted 2 lines

The would give me compiler warnings for unused variables. How does that help?

does gcc issue warnings ? doesn't seem to do so for me.

Quoted 1 line

Is there a keep attribute like the linker has for sections?

yes, __attribute__((used))
-mike

Thanks, since the gcc manual I was using didn't list used, I thought you merely meant to
remove unused.

Seems the gcc version 4.1.2 does not list this option while 4.2.4 does.

What level of compiler is required ?

Troy

#20 lore raw

PATCH 2/2 RFC: Let linker create phy array

Quoted 30 lines · On Monday 06 February 2012 16:44:36 Troy Kisky wrote:
Quoted 20 lines · Mike Frysinger
Quoted 19 lines · On Monday 06 February 2012 15:17:32 Troy Kisky wrote:
Quoted 17 lines · Mike Frysinger
Quoted 5 lines · On Monday 06 February 2012 13:48:13 Troy Kisky wrote:
Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Saturday 04 February 2012 22:02:46 Troy Kisky wrote:
drivers/net/phy/broadcom.c +0 -0
Quoted 8 lines
Quoted 5 lines

drivers/net/phy/broadcom.c

Quoted 2 lines
drivers/net/phy/broadcom.c +1 -1
-static struct phy_driver BCM5461S_driver = {
+struct phy_driver BCM5461S_driver __phy_entry = {

why do you have to remove the static ? that shouldn't affect the section name that it gets placed into.

I had static to start. But the compiler ate all of the code. No references to any of the static symbols.

sounds like you should change the __phy_entry define from "unused" to "used"

Quoted 8 lines
Quoted 2 lines

The would give me compiler warnings for unused variables. How does that help?

does gcc issue warnings ? doesn't seem to do so for me.

Quoted 1 line

Is there a keep attribute like the linker has for sections?

yes, __attribute__((used))

Quoted 7 lines

Thanks, since the gcc manual I was using didn't list used, I thought you merely meant to
remove unused.

Seems the gcc version 4.1.2 does not list this option while 4.2.4 does.

What level of compiler is required ?

in looking at how Linux does things, you should include linux/compiler.h and then utilize __maybe_unused rather than specifying the attribute yourself -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120207/dc467c2e/attachment.pgp>

#21 lore raw

PATCH 1/2 RFC: create u-boot-common.lds

In reply to Troy Kisky
Quoted 2 lines · On Saturday 04 February 2012 22:02:45 Troy Kisky wrote:

arch/blackfin/cpu/u-boot.lds
is warranted.

yes, this change will break Blackfin boards for sure

Quoted 11 lines
arch/blackfin/cpu/u-boot.lds +2 -1
 
 MEMORY
 {
 #if CONFIG_MEM_SIZE
-	ram     : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
 # define ram_code ram
 # define ram_data ram
+	ram (rwx)    : ORIGIN = CONFIG_SYS_MONITOR_BASE, LENGTH = CONFIG_SYS_MONITOR_LEN
+	l1_code : ORIGIN = L1_CODE_ORIGIN,         LENGTH = L1_INST_SRAM_SIZE

arch/blackfin/cpu/u-boot.lds OUTPUT_ARCH(bfin) · line 75

Quoted 10 lines
arch/blackfin/cpu/u-boot.lds +3 -2
+	l1_data : ORIGIN = L1_DATA_B_SRAM,         LENGTH = L1_DATA_B_SRAM_SIZE
 #else
 # define ram_code l1_code
 # define ram_data l1_data
+	l1_code (rx)  : ORIGIN = L1_CODE_ORIGIN,          LENGTH = L1_INST_SRAM_SIZE
+	l1_data (!rx) : ORIGIN = L1_DATA_B_SRAM,         LENGTH = L1_DATA_B_SRAM_SIZE
 #endif
-	l1_code : ORIGIN = L1_CODE_ORIGIN,          LENGTH = L1_INST_SRAM_SIZE
-	l1_data : ORIGIN = L1_DATA_B_SRAM,          LENGTH = L1_DATA_B_SRAM_SIZE
 }

i don't understand ... why is this change necessary ?

i'm not sure the attr's are correct ... the manual says "r" is "read-only" while "w" is "read/write". so i'd expect:

	ram (wx)
	l1_code (x)
	l1_data (w)

arch/blackfin/cpu/u-boot.lds

Quoted 1 line
arch/blackfin/cpu/u-boot.lds +1 -0
+	INCLUDE u-boot-common.lds

since we preprocess our linker scripts now, i'd suggest using #include rather than INCLUDE

u-boot-common.lds line 6

Quoted 9 lines
u-boot-common.lds new file +6 -0
 
+	. = ALIGN(4);
+	__u_boot_cmd_start = .;
+	.u_boot_cmd : {
+		KEEP(*(.u_boot_cmd))
+	}
+	__u_boot_cmd_end = .;

rather than storing this in the top level dir, i'd suggest going the linux route and add a include/asm-generic/u-boot.lds.h header. then we can migrate people over time and piece by piece without having to worry about breaking everyone at once ...

that also allows us to cater to arches (like Blackfin) that have a symbol prefix (underscore in the Blackfin case). add the VMLINUX_SYMBOL() macro, and then this code will look like:

	VMLINUX_SYMBOL(__u_boot_cmd_end) = .;

(i picked VMLINUX_SYMBOL() only because that's what Linux already has defined) -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120205/24a77e89/attachment.pgp>

#22 lore raw

PATCH 1/2 RFC: create u-boot-common.lds

Hi Mike,

Quoted 4 lines · Mike Frysinger

On Saturday 04 February 2012 22:02:45 Troy Kisky wrote:

since we preprocess our linker scripts now, i'd suggest using #include rather than INCLUDE

+1

Quoted 12 lines

u-boot-common.lds

Quoted 9 lines
u-boot-common.lds new file +6 -0
 
+ ? ? . = ALIGN(4);
+ ? ? __u_boot_cmd_start = .;
+ ? ? .u_boot_cmd : {
+ ? ? ? ? ? ? KEEP(*(.u_boot_cmd))
+ ? ? }
+ ? ? __u_boot_cmd_end = .;

rather than storing this in the top level dir, i'd suggest going the linux route and add a include/asm-generic/u-boot.lds.h header. ?then we can migrate

Except it's not a 'header' :) - include/asm-generic/u-boot.lds (or maybe u-boot.lds.common) should be what is included in u-boot.lds and include/asm-generic/u-boot.lds.h should be the externs for the symbols exported from the linker script

Quoted 2 lines

people over time and piece by piece without having to worry about breaking everyone at once ...

Here we go again ;) - Queue the 'what incentive will maintainers have to migrate to the common case' discussion...

On a (related) side not, do we need to lay down some ground rules for migrating to 'common' case? There seems to be a fair amount of new 'common code' or 'common architecture' being developed, but only being applied to one arch. I'm guilty too - my init sequence cleanups which lay the foundation for a common init sequence are only implemented for x86.

Quoted 5 lines

that also allows us to cater to arches (like Blackfin) that have a symbol prefix (underscore in the Blackfin case). ?add the VMLINUX_SYMBOL() macro, and then this code will look like:
? ? ? ?VMLINUX_SYMBOL(__u_boot_cmd_end) = .;
(i picked VMLINUX_SYMBOL() only because that's what Linux already has defined)

How about U_BOOT_LDS_SYMBOL()?

Regards,

Graeme

#23 lore raw

PATCH 1/2 RFC: create u-boot-common.lds

Quoted 16 lines · On Sunday 05 February 2012 17:07:41 Graeme Russ wrote:
Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Saturday 04 February 2012 22:02:45 Troy Kisky wrote:
u-boot-common.lds new file +0 -0
Quoted 10 lines

u-boot-common.lds line 6

Quoted 6 lines
u-boot-common.lds new file +6 -0
+     . = ALIGN(4);
+     __u_boot_cmd_start = .;
+     .u_boot_cmd : {
+             KEEP(*(.u_boot_cmd))
+     }
+     __u_boot_cmd_end = .;

rather than storing this in the top level dir, i'd suggest going the linux route and add a include/asm-generic/u-boot.lds.h header. then we can migrate

Quoted 1 line

Except it's not a 'header' :)

what Troy has posted isn't a header, but what i'm suggesting is. Linux's vmlinux.lds.h does things like:

	#define DISCARDS \
		/DISCARDS/ : { \
		EXIT_TEXT \
		*(.discard) \
		}

and then the arch linker scripts just use:
DISCARDS

Quoted 5 lines
Quoted 2 lines

people over time and piece by piece without having to worry about breaking everyone at once ...

Here we go again ;) - Queue the 'what incentive will maintainers have to migrate to the common case' discussion...

it isn't just that. i don't think a single u-boot.lds for every arch is feasible. the kernel method allows all the common pieces to be in a common header, and then the arches to expand the specific pieces in the specific order. -mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120205/78e7272a/attachment.pgp>

#24 lore raw

PATCH 1/2 RFC: create u-boot-common.lds

Hi Mike,

Quoted 27 lines · Mike Frysinger
Quoted 16 lines · On Sunday 05 February 2012 17:07:41 Graeme Russ wrote:
Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Saturday 04 February 2012 22:02:45 Troy Kisky wrote:
u-boot-common.lds new file +0 -0
Quoted 10 lines
Quoted 6 lines

+ ? ? . = ALIGN(4);
+ ? ? __u_boot_cmd_start = .;
+ ? ? .u_boot_cmd : {
+ ? ? ? ? ? ? KEEP(*(.u_boot_cmd))
+ ? ? }
+ ? ? __u_boot_cmd_end = .;

rather than storing this in the top level dir, i'd suggest going the linux route and add a include/asm-generic/u-boot.lds.h header. ?then we can migrate

Quoted 1 line

Except it's not a 'header' :)

what Troy has posted isn't a header, but what i'm suggesting is. ?Linux's vmlinux.lds.h does things like:
? ? ? ?#define DISCARDS \
? ? ? ? ? ? ? ?/DISCARDS/ : { \
? ? ? ? ? ? ? ?EXIT_TEXT \
? ? ? ? ? ? ? ?*(.discard) \
? ? ? ? ? ? ? ?}

Quoted 2 lines

and then the arch linker scripts just use:
? ? ? ?DISCARDS

Ah, I see. So we could have

#define LDS_U_BOOT_CMD \
	__u_boot_cmd_start = .; \
	.u_boot_cmd : { \
		KEEP(*(.u_boot_cmd)) \
	} \
	__u_boot_cmd_end = .;

And each arch linker script would just have

	. = ALIGN(4);
	LDS_U_BOOT_CMD

Or some such

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

people over time and piece by piece without having to worry about breaking everyone at once ...

Here we go again ;) - Queue the 'what incentive will maintainers have to migrate to the common case' discussion...

it isn't just that. ?i don't think a single u-boot.lds for every arch is feasible. ?the kernel method allows all the common pieces to be in a common header, and then the arches to expand the specific pieces in the specific order.

I can't say I'm a fan of the 'common bits' approach - It really does reduce the readability of the linker script IMHO. It took me long enough to deal with the fact that the lds file is pre-processed for TEXT_BASE ;)

Regards,

Graeme

#25 lore raw

PATCH 1/2 RFC: create u-boot-common.lds

Quoted 9 lines · On Sunday 05 February 2012 22:43:33 Graeme Russ wrote:
Quoted 4 lines · Mike Frysinger

it isn't just that. i don't think a single u-boot.lds for every arch is feasible. the kernel method allows all the common pieces to be in a common header, and then the arches to expand the specific pieces in the specific order.

I can't say I'm a fan of the 'common bits' approach - It really does reduce the readability of the linker script IMHO. It took me long enough to deal with the fact that the lds file is pre-processed for TEXT_BASE ;)

yes, it does make the linker scripts a bit more opaque, but since each arch is doing something unique, it's fairly hard to merge them into a single file. the Linux approach represents what we can do in the real world -- get beyond board-specific linker scripts and to one linker script per arch. then the vmlinux.lds.h merges a lot of the stuff that can be shared between arches.

i've unified all the board/SoC linker scripts for Blackfin and now there is just one -- arch/blackfin/cpu/u-boot.lds.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120205/502d74d8/attachment.pgp>

#26 lore raw

PATCH 1/2 RFC: create u-boot-common.lds

Hi Mike,

Quoted 11 lines · Mike Frysinger
Quoted 9 lines · On Sunday 05 February 2012 22:43:33 Graeme Russ wrote:
Quoted 4 lines · Mike Frysinger

it isn't just that. ?i don't think a single u-boot.lds for every arch is feasible. ?the kernel method allows all the common pieces to be in a common header, and then the arches to expand the specific pieces in the specific order.

I can't say I'm a fan of the 'common bits' approach - It really does reduce the readability of the linker script IMHO. It took me long enough to deal with the fact that the lds file is pre-processed for TEXT_BASE ;)

Quoted 8 lines

yes, it does make the linker scripts a bit more opaque, but since each arch is doing something unique, it's fairly hard to merge them into a single file. ?the Linux approach represents what we can do in the real world -- get beyond board-specific linker scripts and to one linker script per arch. ?then the vmlinux.lds.h merges a lot of the stuff that can be shared between arches.

i've unified all the board/SoC linker scripts for Blackfin and now there is just one -- arch/blackfin/cpu/u-boot.lds.

Ditto for x86

Maybe we should wait until all the arches have unified linker scripts before looking at a global script (parallels with 'skip relocation')?

Regards,

Graeme

#27 lore raw

PATCH 1/2 RFC: create u-boot-common.lds

Quoted 20 lines · On Sunday 05 February 2012 23:34:27 Graeme Russ wrote:
Quoted 19 lines · Mike Frysinger
Quoted 10 lines · On Sunday 05 February 2012 22:43:33 Graeme Russ wrote:
Quoted 4 lines · Mike Frysinger

it isn't just that. i don't think a single u-boot.lds for every arch is feasible. the kernel method allows all the common pieces to be in a common header, and then the arches to expand the specific pieces in the specific order.

I can't say I'm a fan of the 'common bits' approach - It really does reduce the readability of the linker script IMHO. It took me long enough to deal with the fact that the lds file is pre-processed for TEXT_BASE ;)

yes, it does make the linker scripts a bit more opaque, but since each arch is doing something unique, it's fairly hard to merge them into a single file. the Linux approach represents what we can do in the real world -- get beyond board-specific linker scripts and to one linker script per arch. then the vmlinux.lds.h merges a lot of the stuff that can be shared between arches.

Quoted 7 lines
Quoted 2 lines

i've unified all the board/SoC linker scripts for Blackfin and now there is just one -- arch/blackfin/cpu/u-boot.lds.

Ditto for x86

Maybe we should wait until all the arches have unified linker scripts before looking at a global script (parallels with 'skip relocation')?

i don't think we need to wait for that. if we have a header with defines, then any linker script can be converted to that. the arches that have cleaned up can convert over now.

seems like the big offenders in the tree are arm/m68k/mips/ppc. i have a hard time seeing them merging into their arch/ anytime soon.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120206/87125f7a/attachment.pgp>