All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4 1/3] cm_t335: fix linker file to produce full ELF
@ 2014-01-08  8:57 Albert ARIBAUD
  2014-01-08  8:57 ` [U-Boot] [PATCH v4 2/3] arm: make _end compiler-generated Albert ARIBAUD
  0 siblings, 1 reply; 12+ messages in thread
From: Albert ARIBAUD @ 2014-01-08  8:57 UTC (permalink / raw)
  To: u-boot

Newly added cm_t335 was missed in commit 47ed5dd0 which
made ARM targets produce full ELF files. Fix its linker
script.

This change is binary-invariant when only .dynsym, .dynstr,
.dynamic, .plt, .interp and .gun sections are declared.

Sections .hash, .got.plt, .dynbss and .ARM.exidx are also
declared so that their (unused) content is moved out of the
u-boot binary.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
---

Changes in v4: None
Changes in v3:
- fixed cm_t335 linker script

Changes in v2: None

 board/compulab/cm_t335/u-boot.lds | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/board/compulab/cm_t335/u-boot.lds b/board/compulab/cm_t335/u-boot.lds
index 1b609a2..d25c19a 100644
--- a/board/compulab/cm_t335/u-boot.lds
+++ b/board/compulab/cm_t335/u-boot.lds
@@ -92,10 +92,14 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	/DISCARD/ : { *(.dynsym) }
-	/DISCARD/ : { *(.dynstr*) }
-	/DISCARD/ : { *(.dynamic*) }
-	/DISCARD/ : { *(.plt*) }
-	/DISCARD/ : { *(.interp*) }
-	/DISCARD/ : { *(.gnu*) }
+	.dynsym _end : { *(.dynsym) }
+	.hash : { *(.hash) }
+	.got.plt : { *(.got.plt) }
+	.dynbss : { *(.dynbss) }
+	.dynstr : { *(.dynstr*) }
+	.dynamic : { *(.dynamic*) }
+	.plt : { *(.plt*) }
+	.interp : { *(.interp*) }
+	.gnu : { *(.gnu*) }
+	.ARM.exidx : { *(.ARM.exidx*) }
 }
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v4 2/3] arm: make _end compiler-generated
  2014-01-08  8:57 [U-Boot] [PATCH v4 1/3] cm_t335: fix linker file to produce full ELF Albert ARIBAUD
@ 2014-01-08  8:57 ` Albert ARIBAUD
  2014-01-08  8:57   ` [U-Boot] [PATCH v4 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE Albert ARIBAUD
  0 siblings, 1 reply; 12+ messages in thread
From: Albert ARIBAUD @ 2014-01-08  8:57 UTC (permalink / raw)
  To: u-boot

This prevents references to _end from generating absolute
relocation records.

This change is binary invariant for ARM targets.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
---

Changes in v4: None
Changes in v3:
- Replace _end in linker scripts with _image_binary_end

Changes in v2: None

 arch/arm/cpu/arm1136/u-boot-spl.lds            | 6 +++++-
 arch/arm/cpu/arm920t/ep93xx/u-boot.lds         | 5 ++++-
 arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds      | 9 +++++++--
 arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds    | 9 +++++++--
 arch/arm/cpu/armv7/am33xx/u-boot-spl.lds       | 6 +++++-
 arch/arm/cpu/armv7/omap-common/u-boot-spl.lds  | 6 +++++-
 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds      | 6 +++++-
 arch/arm/cpu/at91-common/u-boot-spl.lds        | 6 +++++-
 arch/arm/cpu/ixp/u-boot.lds                    | 9 +++++++--
 arch/arm/cpu/u-boot-spl.lds                    | 9 +++++++--
 arch/arm/cpu/u-boot.lds                        | 9 +++++++--
 arch/arm/lib/Makefile                          | 2 +-
 arch/arm/lib/sections.c                        | 1 +
 board/Barix/ipam390/u-boot-spl-ipam390.lds     | 6 +++++-
 board/actux1/u-boot.lds                        | 9 +++++++--
 board/actux2/u-boot.lds                        | 9 +++++++--
 board/actux3/u-boot.lds                        | 9 +++++++--
 board/ait/cam_enc_4xx/u-boot-spl.lds           | 6 +++++-
 board/compulab/cm_t335/u-boot.lds              | 9 +++++++--
 board/davinci/da8xxevm/u-boot-spl-da850evm.lds | 6 +++++-
 board/davinci/da8xxevm/u-boot-spl-hawk.lds     | 5 ++++-
 board/dvlhost/u-boot.lds                       | 9 +++++++--
 board/freescale/mx31ads/u-boot.lds             | 9 +++++++--
 board/samsung/common/exynos-uboot-spl.lds      | 6 +++++-
 board/ti/am335x/u-boot.lds                     | 9 +++++++--
 board/vpac270/u-boot-spl.lds                   | 9 +++++++--
 26 files changed, 146 insertions(+), 38 deletions(-)

diff --git a/arch/arm/cpu/arm1136/u-boot-spl.lds b/arch/arm/cpu/arm1136/u-boot-spl.lds
index bccde73..0299902 100644
--- a/arch/arm/cpu/arm1136/u-boot-spl.lds
+++ b/arch/arm/cpu/arm1136/u-boot-spl.lds
@@ -33,7 +33,11 @@ SECTIONS
 	.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
 	. = ALIGN(4);
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	}
 
 	.bss :
 	{
diff --git a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
index 4bed4fc..9699404 100644
--- a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
+++ b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
@@ -50,5 +50,8 @@ SECTIONS
 	.bss : { *(.bss*) }
 	__bss_end = .;
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
 }
diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
index 80fb9bd..d0b482d 100644
--- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
@@ -49,9 +49,14 @@ SECTIONS
 		__bss_end = .;
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
index 76b499d..b6d0f65 100644
--- a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
@@ -49,9 +49,14 @@ SECTIONS
 		__bss_end = .;
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds b/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
index 9302856..b1c28c9 100644
--- a/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
@@ -38,7 +38,11 @@ SECTIONS
 
 	. = ALIGN(4);
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	} >.sram
 
 	.bss :
 	{
diff --git a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
index 02aa129..745603d 100644
--- a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
@@ -39,7 +39,11 @@ SECTIONS
 
 	. = ALIGN(4);
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	}
 
 	.bss :
 	{
diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
index a7c9c9d..4282beb 100644
--- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
@@ -28,7 +28,11 @@ SECTIONS
 
 	. = ALIGN(4);
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	}
 
 	.bss : {
 		. = ALIGN(4);
diff --git a/arch/arm/cpu/at91-common/u-boot-spl.lds b/arch/arm/cpu/at91-common/u-boot-spl.lds
index 038335d..57ac1eb 100644
--- a/arch/arm/cpu/at91-common/u-boot-spl.lds
+++ b/arch/arm/cpu/at91-common/u-boot-spl.lds
@@ -37,7 +37,11 @@ SECTIONS
 
 	. = ALIGN(4);
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	} >.sram
 
 	.bss :
 	{
diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds
index 676ae2c..85f8d7a 100644
--- a/arch/arm/cpu/ixp/u-boot.lds
+++ b/arch/arm/cpu/ixp/u-boot.lds
@@ -58,7 +58,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -79,7 +84,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
index 4880d0f..3e88668 100644
--- a/arch/arm/cpu/u-boot-spl.lds
+++ b/arch/arm/cpu/u-boot-spl.lds
@@ -42,7 +42,12 @@ SECTIONS
 		__rel_dyn_end = .;
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 	.bss __rel_dyn_start (OVERLAY) : {
 		__bss_start = .;
@@ -51,7 +56,7 @@ SECTIONS
 		__bss_end = .;
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index 9463a33..4f084e7 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -60,7 +60,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 	/*
 	 * Deprecated: this MMU section is used by pxa at present but
@@ -91,7 +96,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.hash : { *(.hash) }
 	.got.plt : { *(.got.plt) }
 	.dynbss : { *(.dynbss) }
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 679f19a..f39d510 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -24,7 +24,6 @@ obj-y += relocate.o
 ifndef CONFIG_SYS_GENERIC_BOARD
 obj-y	+= board.o
 endif
-obj-y += sections.o
 
 obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
@@ -35,6 +34,7 @@ else
 obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
 endif
 
+obj-y	+= sections.o
 obj-y	+= interrupts.o
 obj-y	+= reset.o
 
diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c
index e35687c..5b30bcb 100644
--- a/arch/arm/lib/sections.c
+++ b/arch/arm/lib/sections.c
@@ -25,3 +25,4 @@ char __image_copy_start[0] __attribute__((section(".__image_copy_start")));
 char __image_copy_end[0] __attribute__((section(".__image_copy_end")));
 char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start")));
 char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end")));
+char _end[0] __attribute__((section(".__end")));
diff --git a/board/Barix/ipam390/u-boot-spl-ipam390.lds b/board/Barix/ipam390/u-boot-spl-ipam390.lds
index 5480d1f..8604696 100644
--- a/board/Barix/ipam390/u-boot-spl-ipam390.lds
+++ b/board/Barix/ipam390/u-boot-spl-ipam390.lds
@@ -49,5 +49,9 @@ SECTIONS
 	} >.sram
 
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	} >.sram
 }
diff --git a/board/actux1/u-boot.lds b/board/actux1/u-boot.lds
index 4716e4f..34cd3a0 100644
--- a/board/actux1/u-boot.lds
+++ b/board/actux1/u-boot.lds
@@ -66,7 +66,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -87,7 +92,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/actux2/u-boot.lds b/board/actux2/u-boot.lds
index f00d7c7..9b68af1 100644
--- a/board/actux2/u-boot.lds
+++ b/board/actux2/u-boot.lds
@@ -66,7 +66,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -87,7 +92,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/actux3/u-boot.lds b/board/actux3/u-boot.lds
index 2de3ca6..9d2febc 100644
--- a/board/actux3/u-boot.lds
+++ b/board/actux3/u-boot.lds
@@ -66,7 +66,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -87,7 +92,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/ait/cam_enc_4xx/u-boot-spl.lds b/board/ait/cam_enc_4xx/u-boot-spl.lds
index fdfbfc3..c0d09ad 100644
--- a/board/ait/cam_enc_4xx/u-boot-spl.lds
+++ b/board/ait/cam_enc_4xx/u-boot-spl.lds
@@ -48,5 +48,9 @@ SECTIONS
 	} >.sram
 
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	}
 }
diff --git a/board/compulab/cm_t335/u-boot.lds b/board/compulab/cm_t335/u-boot.lds
index d25c19a..0984dfe 100644
--- a/board/compulab/cm_t335/u-boot.lds
+++ b/board/compulab/cm_t335/u-boot.lds
@@ -61,7 +61,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 	/*
 	 * Deprecated: this MMU section is used by pxa at present but
@@ -92,7 +97,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.hash : { *(.hash) }
 	.got.plt : { *(.got.plt) }
 	.dynbss : { *(.dynbss) }
diff --git a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
index 5480d1f..de21a13 100644
--- a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
@@ -49,5 +49,9 @@ SECTIONS
 	} >.sram
 
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	}
 }
diff --git a/board/davinci/da8xxevm/u-boot-spl-hawk.lds b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
index d49c314..299226b 100644
--- a/board/davinci/da8xxevm/u-boot-spl-hawk.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
@@ -61,5 +61,8 @@ SECTIONS
 		__bss_end = .;
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
 }
diff --git a/board/dvlhost/u-boot.lds b/board/dvlhost/u-boot.lds
index ebcaf44..0744fee 100644
--- a/board/dvlhost/u-boot.lds
+++ b/board/dvlhost/u-boot.lds
@@ -66,7 +66,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -87,7 +92,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/freescale/mx31ads/u-boot.lds b/board/freescale/mx31ads/u-boot.lds
index 1cca176..6da1d4b 100644
--- a/board/freescale/mx31ads/u-boot.lds
+++ b/board/freescale/mx31ads/u-boot.lds
@@ -69,7 +69,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -90,7 +95,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/samsung/common/exynos-uboot-spl.lds b/board/samsung/common/exynos-uboot-spl.lds
index 8e3b73e..b22f9e0 100644
--- a/board/samsung/common/exynos-uboot-spl.lds
+++ b/board/samsung/common/exynos-uboot-spl.lds
@@ -42,7 +42,11 @@ SECTIONS
 	. = ALIGN(4);
 
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	} >.sram
 
 	.bss :
 	{
diff --git a/board/ti/am335x/u-boot.lds b/board/ti/am335x/u-boot.lds
index 6a734b3..ceb2022 100644
--- a/board/ti/am335x/u-boot.lds
+++ b/board/ti/am335x/u-boot.lds
@@ -77,7 +77,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 	/*
 	 * Deprecated: this MMU section is used by pxa at present but
@@ -108,7 +113,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/vpac270/u-boot-spl.lds b/board/vpac270/u-boot-spl.lds
index 02d107c..318f1ee 100644
--- a/board/vpac270/u-boot-spl.lds
+++ b/board/vpac270/u-boot-spl.lds
@@ -53,7 +53,12 @@ SECTIONS
 
 	. = ALIGN(0x800);
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 	.bss __rel_dyn_start (OVERLAY) : {
 		__bss_start = .;
@@ -62,7 +67,7 @@ SECTIONS
 		__bss_end = .;
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v4 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE
  2014-01-08  8:57 ` [U-Boot] [PATCH v4 2/3] arm: make _end compiler-generated Albert ARIBAUD
@ 2014-01-08  8:57   ` Albert ARIBAUD
  2014-01-30 10:02     ` [U-Boot] [PATCH v5 1/3] cm_t335: fix linker file to produce full ELF Albert ARIBAUD
  0 siblings, 1 reply; 12+ messages in thread
From: Albert ARIBAUD @ 2014-01-08  8:57 UTC (permalink / raw)
  To: u-boot

Remove the last uses of symbol offsets in ARM U-Boot.
Remove some needless uses of _TEXT_BASE.
Remove all _TEXT_BASE definitions.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
---

Changes in v4:
- removed mkexynosspl patch, already fixed in 0fcac1ab

Changes in v3: None
Changes in v2:
- fixed use of _rel_dyn_end instead of _end

 README                                      |  6 ------
 arch/arm/cpu/arm1136/start.S                | 27 ---------------------------
 arch/arm/cpu/arm1176/start.S                | 27 ---------------------------
 arch/arm/cpu/arm720t/start.S                | 26 --------------------------
 arch/arm/cpu/arm920t/start.S                | 26 --------------------------
 arch/arm/cpu/arm926ejs/at91/lowlevel_init.S | 14 +-------------
 arch/arm/cpu/arm926ejs/mxs/start.S          | 27 ---------------------------
 arch/arm/cpu/arm926ejs/start.S              | 27 ---------------------------
 arch/arm/cpu/arm946es/start.S               | 26 --------------------------
 arch/arm/cpu/arm_intcm/start.S              | 26 --------------------------
 arch/arm/cpu/armv7/omap3/lowlevel_init.S    |  3 ---
 arch/arm/cpu/armv7/start.S                  | 23 -----------------------
 arch/arm/cpu/ixp/start.S                    | 26 --------------------------
 arch/arm/cpu/pxa/start.S                    | 27 ---------------------------
 arch/arm/cpu/sa1100/start.S                 | 26 --------------------------
 arch/arm/lib/board.c                        | 12 ++++++------
 board/armltd/integrator/lowlevel_init.S     |  2 +-
 board/cm4008/flash.c                        |  2 +-
 board/cm41xx/flash.c                        |  2 +-
 board/mpl/vcma9/lowlevel_init.S             |  5 +----
 board/mx1ads/lowlevel_init.S                |  4 ----
 board/samsung/goni/lowlevel_init.S          |  3 ---
 board/samsung/smdk2410/lowlevel_init.S      |  5 +----
 board/samsung/smdk5250/lowlevel_init.S      |  5 +----
 board/samsung/smdkc100/lowlevel_init.S      |  3 ---
 board/ti/omap5912osk/lowlevel_init.S        |  4 ----
 common/board_f.c                            | 14 +++-----------
 common/board_r.c                            |  4 ++--
 include/asm-generic/sections.h              | 26 +++++++-------------------
 29 files changed, 25 insertions(+), 403 deletions(-)

diff --git a/README b/README
index 8f0b38c..d9149f3 100644
--- a/README
+++ b/README
@@ -3676,12 +3676,6 @@ Configuration Settings:
 	its config.mk file). If you find problems enabling this option on
 	your board please report the problem and send patches!
 
-- CONFIG_SYS_SYM_OFFSETS
-	This is set by architectures that use offsets for link symbols
-	instead of absolute values. So bss_start is obtained using an
-	offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than
-	directly. You should not need to touch this setting.
-
 - CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC (OMAP only)
 	This is set by OMAP boards for the max time that reset should
 	be asserted. See doc/README.omap-reset-time for details on how
diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 00d1b30..3e2358e 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -70,32 +70,6 @@ _end_vect:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -295,7 +269,6 @@ cpu_init_crit:
 #ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
-	ldr	sp, _TEXT_BASE			/* use 32 words about stack */
 	bl	hang				/* hang and never return */
 #else	/* !CONFIG_SPL_BUILD */
 	.align	5
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index ffd7dd0..ce62011 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -77,33 +77,6 @@ _end_vect:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 /* IRQ stack memory (calculated at run-time) + 8 bytes */
 .globl IRQ_STACK_START_IN
 IRQ_STACK_START_IN:
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index f180eb8..1a34842 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -67,32 +67,6 @@ _pad:			.word 0x12345678 /* now 16*4=64 */
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index a67b659..7bf094a 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -55,32 +55,6 @@ _fiq:			.word fiq
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S b/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
index e83968f..a9ec81a 100644
--- a/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
+++ b/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
@@ -26,27 +26,18 @@
 #define CONFIG_SYS_MATRIX_EBICSA_VAL CONFIG_SYS_MATRIX_EBI0CSA_VAL
 #endif
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 .globl lowlevel_init
 .type lowlevel_init,function
 lowlevel_init:
 
-	mov	r5, pc		/* r5 = POS1 + 4 current */
 POS1:
+	adr	r5, POS1	/* r5 = POS1 run time */
 	ldr	r0, =POS1	/* r0 = POS1 compile */
-	ldr	r2, _TEXT_BASE
-	sub	r0, r0, r2	/* r0 = POS1-_TEXT_BASE (POS1 relative) */
 	sub	r5, r5, r0	/* r0 = CONFIG_SYS_TEXT_BASE-1 */
-	sub	r5, r5, #4	/* r1 = text base - current */
 
 	/* memory control configuration 1 */
 	ldr	r0, =SMRDATA
 	ldr	r2, =SMRDATA1
-	ldr	r1, _TEXT_BASE
-	sub	r0, r0, r1
-	sub	r2, r2, r1
 	add	r0, r0, r5
 	add	r2, r2, r5
 0:
@@ -149,9 +140,6 @@ PLL_setup_end:
 
 	ldr	r0, =SMRDATA1
 	ldr	r2, =SMRDATA2
-	ldr	r1, _TEXT_BASE
-	sub	r0, r0, r1
-	sub	r2, r2, r1
 	add	r0, r0, r5
 	add	r2, r2, r5
 2:
diff --git a/arch/arm/cpu/arm926ejs/mxs/start.S b/arch/arm/cpu/arm926ejs/mxs/start.S
index 5de2bad..34a0fcb 100644
--- a/arch/arm/cpu/arm926ejs/mxs/start.S
+++ b/arch/arm/cpu/arm926ejs/mxs/start.S
@@ -101,32 +101,6 @@ fiq:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#ifdef CONFIG_SPL_TEXT_BASE
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -207,6 +181,5 @@ _reset:
 	bx	lr
 
 _hang:
-	ldr	sp, _TEXT_BASE			/* switch to abort stack */
 1:
 	bl	1b				/* hang and never return */
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 5360f55..0717327 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -102,32 +102,6 @@ _fiq:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -330,7 +304,6 @@ flush_dcache:
 #ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
-	ldr	sp, _TEXT_BASE			/* switch to abort stack */
 1:
 	bl	1b				/* hang and never return */
 #else	/* !CONFIG_SPL_BUILD */
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index e16b088..7d50145 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -71,32 +71,6 @@ _vectors_end:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
index 5783df1..7404ea7 100644
--- a/arch/arm/cpu/arm_intcm/start.S
+++ b/arch/arm/cpu/arm_intcm/start.S
@@ -67,32 +67,6 @@ _fiq:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
index 6f7261b..78577b1 100644
--- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
@@ -17,9 +17,6 @@
 #include <asm/arch/clocks_omap3.h>
 #include <linux/linkage.h>
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE	/* sdram load addr from config.mk */
-
 #ifdef CONFIG_SPL_BUILD
 ENTRY(save_boot_params)
 	ldr	r4, =omap3_boot_device
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 6c9b11a..4ff6268 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -63,29 +63,6 @@ _end_vect:
  *
  *************************************************************************/
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S
index 82c868a..80ef443 100644
--- a/arch/arm/cpu/ixp/start.S
+++ b/arch/arm/cpu/ixp/start.S
@@ -80,32 +80,6 @@ _fiq:			.word fiq
  * - jump to second stage
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
index d8fb812..ae0d13c 100644
--- a/arch/arm/cpu/pxa/start.S
+++ b/arch/arm/cpu/pxa/start.S
@@ -84,32 +84,6 @@ _end_vect:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -316,7 +290,6 @@ cpu_init_crit:
 #ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
-	ldr	sp, _TEXT_BASE			/* use 32 words about stack */
 	bl	hang				/* hang and never return */
 #else	/* !CONFIG_SPL_BUILD */
 	.align	5
diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
index 27bcda5..bf80937 100644
--- a/arch/arm/cpu/sa1100/start.S
+++ b/arch/arm/cpu/sa1100/start.S
@@ -56,32 +56,6 @@ _fiq:			.word fiq
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 9c72a53..09879a7 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -105,8 +105,8 @@ static int display_banner(void)
 {
 	printf("\n\n%s\n\n", version_string);
 	debug("U-Boot code: %08lX -> %08lX  BSS: -> %08lX\n",
-	       _TEXT_BASE,
-	       _bss_start_ofs + _TEXT_BASE, _bss_end_ofs + _TEXT_BASE);
+	       (ulong)&_start,
+	       (ulong)&__bss_start, (ulong)&__bss_end);
 #ifdef CONFIG_MODEM_SUPPORT
 	debug("Modem Support enabled\n");
 #endif
@@ -277,13 +277,13 @@ void board_init_f(ulong bootflag)
 
 	memset((void *)gd, 0, sizeof(gd_t));
 
-	gd->mon_len = _bss_end_ofs;
+	gd->mon_len = (ulong)&__bss_end - (ulong)_start;
 #ifdef CONFIG_OF_EMBED
 	/* Get a pointer to the FDT */
 	gd->fdt_blob = _binary_dt_dtb_start;
 #elif defined CONFIG_OF_SEPARATE
 	/* FDT is at end of image */
-	gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
+	gd->fdt_blob = &_end;
 #endif
 	/* Allow the early environment to override the fdt address */
 	gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
@@ -450,7 +450,7 @@ void board_init_f(ulong bootflag)
 
 	gd->relocaddr = addr;
 	gd->start_addr_sp = addr_sp;
-	gd->reloc_off = addr - _TEXT_BASE;
+	gd->reloc_off = addr - (ulong)&_start;
 	debug("relocation Offset is: %08lx\n", gd->reloc_off);
 	if (new_fdt) {
 		memcpy(new_fdt, gd->fdt_blob, fdt_size);
@@ -515,7 +515,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	gd->flags |= GD_FLG_RELOC;	/* tell others: relocation done */
 	bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
 
-	monitor_flash_len = _end_ofs;
+	monitor_flash_len = (ulong)&__rel_dyn_end - (ulong)_start;
 
 	/* Enable caches */
 	enable_caches();
diff --git a/board/armltd/integrator/lowlevel_init.S b/board/armltd/integrator/lowlevel_init.S
index 389d5e9..0fb42ad 100644
--- a/board/armltd/integrator/lowlevel_init.S
+++ b/board/armltd/integrator/lowlevel_init.S
@@ -183,7 +183,7 @@ cm_remap:
 
 	/* Now 0x00000000 is writeable, replace the vectors	*/
 	ldr	r0, =_start	/* r0 <- start of vectors	*/
-	ldr	r2, =_TEXT_BASE	/* r2 <- past vectors	*/
+	add	r2, r0, #64	/* r2 <- past vectors	*/
 	sub	r1,r1,r1		/* destination 0x00000000	*/
 
 copy_vec:
diff --git a/board/cm4008/flash.c b/board/cm4008/flash.c
index 2511928..8315a57 100644
--- a/board/cm4008/flash.c
+++ b/board/cm4008/flash.c
@@ -57,7 +57,7 @@ unsigned long flash_init (void)
 	 */
 	flash_protect (FLAG_PROTECT_SET,
 		       CONFIG_SYS_FLASH_BASE,
-		       CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
+		       CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start),
 		       &flash_info[0]);
 
 	return size;
diff --git a/board/cm41xx/flash.c b/board/cm41xx/flash.c
index 2511928..8315a57 100644
--- a/board/cm41xx/flash.c
+++ b/board/cm41xx/flash.c
@@ -57,7 +57,7 @@ unsigned long flash_init (void)
 	 */
 	flash_protect (FLAG_PROTECT_SET,
 		       CONFIG_SYS_FLASH_BASE,
-		       CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
+		       CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start),
 		       &flash_info[0]);
 
 	return size;
diff --git a/board/mpl/vcma9/lowlevel_init.S b/board/mpl/vcma9/lowlevel_init.S
index b889cf9..cca9c0c 100644
--- a/board/mpl/vcma9/lowlevel_init.S
+++ b/board/mpl/vcma9/lowlevel_init.S
@@ -197,13 +197,10 @@
 #define REFCNT_266		0
 /**************************************/
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 .globl lowlevel_init
 lowlevel_init:
 	/* use r0 to relocate DATA read/write to flash rather than memory ! */
-	ldr	r0, _TEXT_BASE
+	ldr	r0, =CONFIG_SYS_TEXT_BASE
 	ldr	r13, =BWSCON
 
 	/* enable minimal access to PLD */
diff --git a/board/mx1ads/lowlevel_init.S b/board/mx1ads/lowlevel_init.S
index d1e472a..3e713cc 100644
--- a/board/mx1ads/lowlevel_init.S
+++ b/board/mx1ads/lowlevel_init.S
@@ -16,10 +16,6 @@
 #define SDCTL0			0x221000
 #define SDCTL1			0x221004
 
-
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 .globl lowlevel_init
 lowlevel_init:
 /* memory controller init		*/
diff --git a/board/samsung/goni/lowlevel_init.S b/board/samsung/goni/lowlevel_init.S
index 726211a..d52bc09 100644
--- a/board/samsung/goni/lowlevel_init.S
+++ b/board/samsung/goni/lowlevel_init.S
@@ -22,9 +22,6 @@
  * r9 has Mobile DDR size, 1 means 1GiB, 2 means 2GiB and so on
  */
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 	.globl lowlevel_init
 lowlevel_init:
 	mov	r11, lr
diff --git a/board/samsung/smdk2410/lowlevel_init.S b/board/samsung/smdk2410/lowlevel_init.S
index c7b78fd..5de04f1 100644
--- a/board/samsung/smdk2410/lowlevel_init.S
+++ b/board/samsung/smdk2410/lowlevel_init.S
@@ -110,16 +110,13 @@
 #define REFCNT			1113	/* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */
 /**************************************/
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 .globl lowlevel_init
 lowlevel_init:
 	/* memory control configuration */
 	/* make r0 relative the current location so that it */
 	/* reads SMRDATA out of FLASH rather than memory ! */
 	ldr     r0, =SMRDATA
-	ldr	r1, _TEXT_BASE
+	ldr	r1, =CONFIG_SYS_TEXT_BASE
 	sub	r0, r0, r1
 	ldr	r1, =BWSCON	/* Bus Width Status Controller */
 	add     r2, r0, #13*4
diff --git a/board/samsung/smdk5250/lowlevel_init.S b/board/samsung/smdk5250/lowlevel_init.S
index 9003e2d..8e389cc 100644
--- a/board/samsung/smdk5250/lowlevel_init.S
+++ b/board/samsung/smdk5250/lowlevel_init.S
@@ -10,9 +10,6 @@
 #include <version.h>
 #include <asm/arch/cpu.h>
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 	.globl lowlevel_init
 lowlevel_init:
 
@@ -47,7 +44,7 @@ lowlevel_init:
 	ldr	r0, =0x0ffffff		/* r0 <- Mask Bits*/
 	bic	r1, pc, r0		/* pc <- current addr of code */
 					/* r1 <- unmasked bits of pc */
-	ldr	r2, _TEXT_BASE		/* r2 <- original base addr in ram */
+	ldr	r2, =CONFIG_SYS_TEXT_BASE /* r2 <- original base addr in ram */
 	bic	r2, r2, r0		/* r2 <- unmasked bits of r2*/
 	cmp	r1, r2			/* compare r1, r2 */
 	beq	1f			/* r0 == r1 then skip sdram init */
diff --git a/board/samsung/smdkc100/lowlevel_init.S b/board/samsung/smdkc100/lowlevel_init.S
index 4df0974..65e6b7a 100644
--- a/board/samsung/smdkc100/lowlevel_init.S
+++ b/board/samsung/smdkc100/lowlevel_init.S
@@ -17,9 +17,6 @@
  * r5 has zero always
  */
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 	.globl lowlevel_init
 lowlevel_init:
 	mov	r9, lr
diff --git a/board/ti/omap5912osk/lowlevel_init.S b/board/ti/omap5912osk/lowlevel_init.S
index cad0a5a..e05a1c7 100644
--- a/board/ti/omap5912osk/lowlevel_init.S
+++ b/board/ti/omap5912osk/lowlevel_init.S
@@ -18,10 +18,6 @@
 #include <./configs/omap1510.h>
 #endif
 
-
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE	/* sdram load addr from config.mk */
-
 .globl lowlevel_init
 lowlevel_init:
 
diff --git a/common/board_f.c b/common/board_f.c
index f0664bc..15f8b79 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -149,13 +149,9 @@ static int display_text_info(void)
 #ifndef CONFIG_SANDBOX
 	ulong bss_start, bss_end;
 
-#ifdef CONFIG_SYS_SYM_OFFSETS
-	bss_start = _bss_start_ofs + _TEXT_BASE;
-	bss_end = _bss_end_ofs + _TEXT_BASE;
-#else
 	bss_start = (ulong)&__bss_start;
 	bss_end = (ulong)&__bss_end;
-#endif
+
 	debug("U-Boot code: %08X -> %08lX  BSS: -> %08lX\n",
 	      CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
 #endif
@@ -279,8 +275,8 @@ static int zero_global_data(void)
 
 static int setup_mon_len(void)
 {
-#ifdef CONFIG_SYS_SYM_OFFSETS
-	gd->mon_len = _bss_end_ofs;
+#ifdef __ARM__
+	gd->mon_len = (ulong)&__bss_end - (ulong)_start;
 #elif defined(CONFIG_SANDBOX)
 	gd->mon_len = (ulong)&_end - (ulong)_init;
 #else
@@ -362,11 +358,7 @@ static int setup_fdt(void)
 	gd->fdt_blob = _binary_dt_dtb_start;
 #elif defined CONFIG_OF_SEPARATE
 	/* FDT is at end of image */
-# ifdef CONFIG_SYS_SYM_OFFSETS
-	gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE);
-# else
 	gd->fdt_blob = (ulong *)&_end;
-# endif
 #elif defined(CONFIG_OF_HOSTFILE)
 	if (read_fdt_from_file()) {
 		puts("Failed to read control FDT\n");
diff --git a/common/board_r.c b/common/board_r.c
index 86ca1cb..9d84d14 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -128,8 +128,8 @@ __weak int fixup_cpu(void)
 
 static int initr_reloc_global_data(void)
 {
-#ifdef CONFIG_SYS_SYM_OFFSETS
-	monitor_flash_len = _end_ofs;
+#ifdef __ARM__
+	monitor_flash_len = _end - __image_copy_start;
 #elif !defined(CONFIG_SANDBOX)
 	monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
 #endif
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 7e1eb4b..458952f 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -63,28 +63,16 @@ extern char __image_copy_end[];
 extern void _start(void);
 
 /*
- * ARM needs to use offsets for symbols, since the values of some symbols
- * are not resolved prior to relocation (and are just 0). Maybe this can be
- * resolved, or maybe other architectures are similar, iwc this should be
- * promoted to an architecture option.
+ * ARM defines its symbols as char[]. Other arches define them as ulongs.
  */
 #ifdef CONFIG_ARM
-#define CONFIG_SYS_SYM_OFFSETS
-#endif
-
-#ifdef CONFIG_SYS_SYM_OFFSETS
-/* Start/end of the relocation entries, as an offset from _start */
-extern ulong _rel_dyn_start_ofs;
-extern ulong _rel_dyn_end_ofs;
-
-/* End of the region to be relocated, as an offset form _start */
-extern ulong _image_copy_end_ofs;
 
-extern ulong _bss_start_ofs;	/* BSS start relative to _start */
-extern ulong _bss_end_ofs;		/* BSS end relative to _start */
-extern ulong _end_ofs;		/* end of image relative to _start */
-
-extern ulong _TEXT_BASE;	/* code start */
+extern char __bss_start[];
+extern char __bss_end[];
+extern char __image_copy_start[];
+extern char __image_copy_end[];
+extern char __rel_dyn_start[];
+extern char __rel_dyn_end[];
 
 #else /* don't use offsets: */
 
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v5 1/3] cm_t335: fix linker file to produce full ELF
  2014-01-08  8:57   ` [U-Boot] [PATCH v4 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE Albert ARIBAUD
@ 2014-01-30 10:02     ` Albert ARIBAUD
  2014-01-30 10:02       ` [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated Albert ARIBAUD
  0 siblings, 1 reply; 12+ messages in thread
From: Albert ARIBAUD @ 2014-01-30 10:02 UTC (permalink / raw)
  To: u-boot

Newly added cm_t335 was missed in commit 47ed5dd0 which
made ARM targets produce full ELF files. Fix its linker
script.

This change is binary-invariant when only .dynsym, .dynstr,
.dynamic, .plt, .interp and .gun sections are declared.

Sections .hash, .got.plt, .dynbss and .ARM.exidx are also
declared so that their (unused) content is moved out of the
u-boot binary.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
---

Changes in v5: None
Changes in v4: None
Changes in v3:
- fixed cm_t335 linker script

Changes in v2: None

 board/compulab/cm_t335/u-boot.lds | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/board/compulab/cm_t335/u-boot.lds b/board/compulab/cm_t335/u-boot.lds
index 1b609a2..d25c19a 100644
--- a/board/compulab/cm_t335/u-boot.lds
+++ b/board/compulab/cm_t335/u-boot.lds
@@ -92,10 +92,14 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	/DISCARD/ : { *(.dynsym) }
-	/DISCARD/ : { *(.dynstr*) }
-	/DISCARD/ : { *(.dynamic*) }
-	/DISCARD/ : { *(.plt*) }
-	/DISCARD/ : { *(.interp*) }
-	/DISCARD/ : { *(.gnu*) }
+	.dynsym _end : { *(.dynsym) }
+	.hash : { *(.hash) }
+	.got.plt : { *(.got.plt) }
+	.dynbss : { *(.dynbss) }
+	.dynstr : { *(.dynstr*) }
+	.dynamic : { *(.dynamic*) }
+	.plt : { *(.plt*) }
+	.interp : { *(.interp*) }
+	.gnu : { *(.gnu*) }
+	.ARM.exidx : { *(.ARM.exidx*) }
 }
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated
  2014-01-30 10:02     ` [U-Boot] [PATCH v5 1/3] cm_t335: fix linker file to produce full ELF Albert ARIBAUD
@ 2014-01-30 10:02       ` Albert ARIBAUD
  2014-01-30 10:02         ` [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE Albert ARIBAUD
  2014-01-30 12:09         ` [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated Benoît Thébaudeau
  0 siblings, 2 replies; 12+ messages in thread
From: Albert ARIBAUD @ 2014-01-30 10:02 UTC (permalink / raw)
  To: u-boot

This prevents references to _end from generating absolute
relocation records.

This change is binary invariant for ARM targets.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
---

Changes in v5:
- Rebase onto u-boot-arm/master

Changes in v4: None
Changes in v3:
- Replace _end in linker scripts with _image_binary_end

Changes in v2: None

 arch/arm/cpu/arm1136/u-boot-spl.lds            |  6 +++++-
 arch/arm/cpu/arm920t/ep93xx/u-boot.lds         |  5 ++++-
 arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds      |  9 +++++++--
 arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds    |  9 +++++++--
 arch/arm/cpu/armv7/am33xx/u-boot-spl.lds       |  6 +++++-
 arch/arm/cpu/armv7/omap-common/u-boot-spl.lds  |  6 +++++-
 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds      |  6 +++++-
 arch/arm/cpu/at91-common/u-boot-spl.lds        |  6 +++++-
 arch/arm/cpu/ixp/u-boot.lds                    |  9 +++++++--
 arch/arm/cpu/u-boot-spl.lds                    |  9 +++++++--
 arch/arm/cpu/u-boot.lds                        | 11 +++++++++--
 arch/arm/lib/Makefile                          |  2 +-
 arch/arm/lib/sections.c                        |  1 +
 board/Barix/ipam390/u-boot-spl-ipam390.lds     |  6 +++++-
 board/actux1/u-boot.lds                        |  9 +++++++--
 board/actux2/u-boot.lds                        |  9 +++++++--
 board/actux3/u-boot.lds                        |  9 +++++++--
 board/ait/cam_enc_4xx/u-boot-spl.lds           |  6 +++++-
 board/compulab/cm_t335/u-boot.lds              |  9 +++++++--
 board/davinci/da8xxevm/u-boot-spl-da850evm.lds |  6 +++++-
 board/davinci/da8xxevm/u-boot-spl-hawk.lds     |  5 ++++-
 board/dvlhost/u-boot.lds                       |  9 +++++++--
 board/freescale/mx31ads/u-boot.lds             |  9 +++++++--
 board/samsung/common/exynos-uboot-spl.lds      |  6 +++++-
 board/ti/am335x/u-boot.lds                     |  9 +++++++--
 board/vpac270/u-boot-spl.lds                   |  9 +++++++--
 26 files changed, 148 insertions(+), 38 deletions(-)

diff --git a/arch/arm/cpu/arm1136/u-boot-spl.lds b/arch/arm/cpu/arm1136/u-boot-spl.lds
index bccde73..0299902 100644
--- a/arch/arm/cpu/arm1136/u-boot-spl.lds
+++ b/arch/arm/cpu/arm1136/u-boot-spl.lds
@@ -33,7 +33,11 @@ SECTIONS
 	.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
 	. = ALIGN(4);
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	}
 
 	.bss :
 	{
diff --git a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
index 4bed4fc..9699404 100644
--- a/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
+++ b/arch/arm/cpu/arm920t/ep93xx/u-boot.lds
@@ -50,5 +50,8 @@ SECTIONS
 	.bss : { *(.bss*) }
 	__bss_end = .;
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
 }
diff --git a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
index 80fb9bd..d0b482d 100644
--- a/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds
@@ -49,9 +49,14 @@ SECTIONS
 		__bss_end = .;
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
index 76b499d..b6d0f65 100644
--- a/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
+++ b/arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds
@@ -49,9 +49,14 @@ SECTIONS
 		__bss_end = .;
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds b/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
index 9302856..b1c28c9 100644
--- a/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/am33xx/u-boot-spl.lds
@@ -38,7 +38,11 @@ SECTIONS
 
 	. = ALIGN(4);
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	} >.sram
 
 	.bss :
 	{
diff --git a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
index 02aa129..745603d 100644
--- a/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/omap-common/u-boot-spl.lds
@@ -39,7 +39,11 @@ SECTIONS
 
 	. = ALIGN(4);
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	}
 
 	.bss :
 	{
diff --git a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
index a7c9c9d..4282beb 100644
--- a/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
+++ b/arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
@@ -28,7 +28,11 @@ SECTIONS
 
 	. = ALIGN(4);
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	}
 
 	.bss : {
 		. = ALIGN(4);
diff --git a/arch/arm/cpu/at91-common/u-boot-spl.lds b/arch/arm/cpu/at91-common/u-boot-spl.lds
index 038335d..57ac1eb 100644
--- a/arch/arm/cpu/at91-common/u-boot-spl.lds
+++ b/arch/arm/cpu/at91-common/u-boot-spl.lds
@@ -37,7 +37,11 @@ SECTIONS
 
 	. = ALIGN(4);
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	} >.sram
 
 	.bss :
 	{
diff --git a/arch/arm/cpu/ixp/u-boot.lds b/arch/arm/cpu/ixp/u-boot.lds
index 676ae2c..85f8d7a 100644
--- a/arch/arm/cpu/ixp/u-boot.lds
+++ b/arch/arm/cpu/ixp/u-boot.lds
@@ -58,7 +58,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -79,7 +84,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/arch/arm/cpu/u-boot-spl.lds b/arch/arm/cpu/u-boot-spl.lds
index 4880d0f..3e88668 100644
--- a/arch/arm/cpu/u-boot-spl.lds
+++ b/arch/arm/cpu/u-boot-spl.lds
@@ -42,7 +42,12 @@ SECTIONS
 		__rel_dyn_end = .;
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 	.bss __rel_dyn_start (OVERLAY) : {
 		__bss_start = .;
@@ -51,7 +56,7 @@ SECTIONS
 		__bss_end = .;
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index 4da5d24..f61ef50 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -60,7 +60,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 	/*
 	 * Deprecated: this MMU section is used by pxa at present but
@@ -91,7 +96,9 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
+	.hash : { *(.hash) }
+	.got.plt : { *(.got.plt) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index 321997c..45febcf 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -32,7 +32,6 @@ endif
 ifndef CONFIG_SYS_GENERIC_BOARD
 obj-y	+= board.o
 endif
-obj-y	+= sections.o
 
 obj-$(CONFIG_OF_LIBFDT) += bootm-fdt.o
 obj-$(CONFIG_CMD_BOOTM) += bootm.o
@@ -43,6 +42,7 @@ else
 obj-$(CONFIG_SPL_FRAMEWORK) += spl.o
 endif
 
+obj-y	+= sections.o
 ifdef CONFIG_ARM64
 obj-y	+= interrupts_64.o
 else
diff --git a/arch/arm/lib/sections.c b/arch/arm/lib/sections.c
index e35687c..5b30bcb 100644
--- a/arch/arm/lib/sections.c
+++ b/arch/arm/lib/sections.c
@@ -25,3 +25,4 @@ char __image_copy_start[0] __attribute__((section(".__image_copy_start")));
 char __image_copy_end[0] __attribute__((section(".__image_copy_end")));
 char __rel_dyn_start[0] __attribute__((section(".__rel_dyn_start")));
 char __rel_dyn_end[0] __attribute__((section(".__rel_dyn_end")));
+char _end[0] __attribute__((section(".__end")));
diff --git a/board/Barix/ipam390/u-boot-spl-ipam390.lds b/board/Barix/ipam390/u-boot-spl-ipam390.lds
index 5480d1f..8604696 100644
--- a/board/Barix/ipam390/u-boot-spl-ipam390.lds
+++ b/board/Barix/ipam390/u-boot-spl-ipam390.lds
@@ -49,5 +49,9 @@ SECTIONS
 	} >.sram
 
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	} >.sram
 }
diff --git a/board/actux1/u-boot.lds b/board/actux1/u-boot.lds
index 4716e4f..34cd3a0 100644
--- a/board/actux1/u-boot.lds
+++ b/board/actux1/u-boot.lds
@@ -66,7 +66,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -87,7 +92,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/actux2/u-boot.lds b/board/actux2/u-boot.lds
index f00d7c7..9b68af1 100644
--- a/board/actux2/u-boot.lds
+++ b/board/actux2/u-boot.lds
@@ -66,7 +66,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -87,7 +92,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/actux3/u-boot.lds b/board/actux3/u-boot.lds
index 2de3ca6..9d2febc 100644
--- a/board/actux3/u-boot.lds
+++ b/board/actux3/u-boot.lds
@@ -66,7 +66,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -87,7 +92,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/ait/cam_enc_4xx/u-boot-spl.lds b/board/ait/cam_enc_4xx/u-boot-spl.lds
index fdfbfc3..c0d09ad 100644
--- a/board/ait/cam_enc_4xx/u-boot-spl.lds
+++ b/board/ait/cam_enc_4xx/u-boot-spl.lds
@@ -48,5 +48,9 @@ SECTIONS
 	} >.sram
 
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	}
 }
diff --git a/board/compulab/cm_t335/u-boot.lds b/board/compulab/cm_t335/u-boot.lds
index d25c19a..0984dfe 100644
--- a/board/compulab/cm_t335/u-boot.lds
+++ b/board/compulab/cm_t335/u-boot.lds
@@ -61,7 +61,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 	/*
 	 * Deprecated: this MMU section is used by pxa at present but
@@ -92,7 +97,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.hash : { *(.hash) }
 	.got.plt : { *(.got.plt) }
 	.dynbss : { *(.dynbss) }
diff --git a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
index 5480d1f..de21a13 100644
--- a/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
@@ -49,5 +49,9 @@ SECTIONS
 	} >.sram
 
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	}
 }
diff --git a/board/davinci/da8xxevm/u-boot-spl-hawk.lds b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
index d49c314..299226b 100644
--- a/board/davinci/da8xxevm/u-boot-spl-hawk.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
@@ -61,5 +61,8 @@ SECTIONS
 		__bss_end = .;
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
 }
diff --git a/board/dvlhost/u-boot.lds b/board/dvlhost/u-boot.lds
index ebcaf44..0744fee 100644
--- a/board/dvlhost/u-boot.lds
+++ b/board/dvlhost/u-boot.lds
@@ -66,7 +66,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -87,7 +92,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/freescale/mx31ads/u-boot.lds b/board/freescale/mx31ads/u-boot.lds
index 1cca176..6da1d4b 100644
--- a/board/freescale/mx31ads/u-boot.lds
+++ b/board/freescale/mx31ads/u-boot.lds
@@ -69,7 +69,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 /*
  * Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
@@ -90,7 +95,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/samsung/common/exynos-uboot-spl.lds b/board/samsung/common/exynos-uboot-spl.lds
index 8e3b73e..b22f9e0 100644
--- a/board/samsung/common/exynos-uboot-spl.lds
+++ b/board/samsung/common/exynos-uboot-spl.lds
@@ -42,7 +42,11 @@ SECTIONS
 	. = ALIGN(4);
 
 	__image_copy_end = .;
-	_end = .;
+
+	.end :
+	{
+		*(.__end)
+	} >.sram
 
 	.bss :
 	{
diff --git a/board/ti/am335x/u-boot.lds b/board/ti/am335x/u-boot.lds
index 6a734b3..ceb2022 100644
--- a/board/ti/am335x/u-boot.lds
+++ b/board/ti/am335x/u-boot.lds
@@ -77,7 +77,12 @@ SECTIONS
 		*(.__rel_dyn_end)
 	}
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 	/*
 	 * Deprecated: this MMU section is used by pxa at present but
@@ -108,7 +113,7 @@ SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
diff --git a/board/vpac270/u-boot-spl.lds b/board/vpac270/u-boot-spl.lds
index b6fdde4..5dbf94e 100644
--- a/board/vpac270/u-boot-spl.lds
+++ b/board/vpac270/u-boot-spl.lds
@@ -54,7 +54,12 @@ SECTIONS
 
 	. = ALIGN(0x800);
 
-	_end = .;
+	.end :
+	{
+		*(.__end)
+	}
+
+	_image_binary_end = .;
 
 	.bss __rel_dyn_start (OVERLAY) : {
 		__bss_start = .;
@@ -63,7 +68,7 @@ SECTIONS
 		__bss_end = .;
 	}
 
-	.dynsym _end : { *(.dynsym) }
+	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }
 	.dynamic : { *(.dynamic*) }
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE
  2014-01-30 10:02       ` [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated Albert ARIBAUD
@ 2014-01-30 10:02         ` Albert ARIBAUD
  2014-02-14  4:30           ` Minkyu Kang
  2014-01-30 12:09         ` [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated Benoît Thébaudeau
  1 sibling, 1 reply; 12+ messages in thread
From: Albert ARIBAUD @ 2014-01-30 10:02 UTC (permalink / raw)
  To: u-boot

Remove the last uses of symbol offsets in ARM U-Boot.
Remove some needless uses of _TEXT_BASE.
Remove all _TEXT_BASE definitions.

Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
---

Changes in v5: None
Changes in v4:
- removed mkexynosspl patch, already fixed in 0fcac1ab

Changes in v3: None
Changes in v2:
- fixed use of _rel_dyn_end instead of _end

 README                                      |  6 ------
 arch/arm/cpu/arm1136/start.S                | 27 ---------------------------
 arch/arm/cpu/arm1176/start.S                | 27 ---------------------------
 arch/arm/cpu/arm720t/start.S                | 26 --------------------------
 arch/arm/cpu/arm920t/start.S                | 26 --------------------------
 arch/arm/cpu/arm926ejs/at91/lowlevel_init.S | 14 +-------------
 arch/arm/cpu/arm926ejs/mxs/start.S          | 27 ---------------------------
 arch/arm/cpu/arm926ejs/start.S              | 27 ---------------------------
 arch/arm/cpu/arm946es/start.S               | 26 --------------------------
 arch/arm/cpu/arm_intcm/start.S              | 26 --------------------------
 arch/arm/cpu/armv7/omap3/lowlevel_init.S    |  3 ---
 arch/arm/cpu/armv7/start.S                  | 23 -----------------------
 arch/arm/cpu/ixp/start.S                    | 26 --------------------------
 arch/arm/cpu/pxa/start.S                    | 27 ---------------------------
 arch/arm/cpu/sa1100/start.S                 | 26 --------------------------
 arch/arm/lib/board.c                        | 12 ++++++------
 board/armltd/integrator/lowlevel_init.S     |  2 +-
 board/cm4008/flash.c                        |  2 +-
 board/cm41xx/flash.c                        |  2 +-
 board/mpl/vcma9/lowlevel_init.S             |  5 +----
 board/samsung/goni/lowlevel_init.S          |  3 ---
 board/samsung/smdk2410/lowlevel_init.S      |  5 +----
 board/samsung/smdk5250/lowlevel_init.S      |  5 +----
 board/samsung/smdkc100/lowlevel_init.S      |  3 ---
 board/ti/omap5912osk/lowlevel_init.S        |  4 ----
 common/board_f.c                            | 14 +++-----------
 common/board_r.c                            |  4 ++--
 include/asm-generic/sections.h              | 26 +++++++-------------------
 28 files changed, 25 insertions(+), 399 deletions(-)

diff --git a/README b/README
index 176de61..405b550 100644
--- a/README
+++ b/README
@@ -3699,12 +3699,6 @@ Configuration Settings:
 	its config.mk file). If you find problems enabling this option on
 	your board please report the problem and send patches!
 
-- CONFIG_SYS_SYM_OFFSETS
-	This is set by architectures that use offsets for link symbols
-	instead of absolute values. So bss_start is obtained using an
-	offset _bss_start_ofs from CONFIG_SYS_TEXT_BASE, rather than
-	directly. You should not need to touch this setting.
-
 - CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC (OMAP only)
 	This is set by OMAP boards for the max time that reset should
 	be asserted. See doc/README.omap-reset-time for details on how
diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 00d1b30..3e2358e 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -70,32 +70,6 @@ _end_vect:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -295,7 +269,6 @@ cpu_init_crit:
 #ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
-	ldr	sp, _TEXT_BASE			/* use 32 words about stack */
 	bl	hang				/* hang and never return */
 #else	/* !CONFIG_SPL_BUILD */
 	.align	5
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index ffd7dd0..ce62011 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -77,33 +77,6 @@ _end_vect:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 /* IRQ stack memory (calculated at run-time) + 8 bytes */
 .globl IRQ_STACK_START_IN
 IRQ_STACK_START_IN:
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index f180eb8..1a34842 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -67,32 +67,6 @@ _pad:			.word 0x12345678 /* now 16*4=64 */
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index a67b659..7bf094a 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -55,32 +55,6 @@ _fiq:			.word fiq
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S b/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
index e83968f..a9ec81a 100644
--- a/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
+++ b/arch/arm/cpu/arm926ejs/at91/lowlevel_init.S
@@ -26,27 +26,18 @@
 #define CONFIG_SYS_MATRIX_EBICSA_VAL CONFIG_SYS_MATRIX_EBI0CSA_VAL
 #endif
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 .globl lowlevel_init
 .type lowlevel_init,function
 lowlevel_init:
 
-	mov	r5, pc		/* r5 = POS1 + 4 current */
 POS1:
+	adr	r5, POS1	/* r5 = POS1 run time */
 	ldr	r0, =POS1	/* r0 = POS1 compile */
-	ldr	r2, _TEXT_BASE
-	sub	r0, r0, r2	/* r0 = POS1-_TEXT_BASE (POS1 relative) */
 	sub	r5, r5, r0	/* r0 = CONFIG_SYS_TEXT_BASE-1 */
-	sub	r5, r5, #4	/* r1 = text base - current */
 
 	/* memory control configuration 1 */
 	ldr	r0, =SMRDATA
 	ldr	r2, =SMRDATA1
-	ldr	r1, _TEXT_BASE
-	sub	r0, r0, r1
-	sub	r2, r2, r1
 	add	r0, r0, r5
 	add	r2, r2, r5
 0:
@@ -149,9 +140,6 @@ PLL_setup_end:
 
 	ldr	r0, =SMRDATA1
 	ldr	r2, =SMRDATA2
-	ldr	r1, _TEXT_BASE
-	sub	r0, r0, r1
-	sub	r2, r2, r1
 	add	r0, r0, r5
 	add	r2, r2, r5
 2:
diff --git a/arch/arm/cpu/arm926ejs/mxs/start.S b/arch/arm/cpu/arm926ejs/mxs/start.S
index 5de2bad..34a0fcb 100644
--- a/arch/arm/cpu/arm926ejs/mxs/start.S
+++ b/arch/arm/cpu/arm926ejs/mxs/start.S
@@ -101,32 +101,6 @@ fiq:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#ifdef CONFIG_SPL_TEXT_BASE
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -207,6 +181,5 @@ _reset:
 	bx	lr
 
 _hang:
-	ldr	sp, _TEXT_BASE			/* switch to abort stack */
 1:
 	bl	1b				/* hang and never return */
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 5360f55..0717327 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -102,32 +102,6 @@ _fiq:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -330,7 +304,6 @@ flush_dcache:
 #ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
-	ldr	sp, _TEXT_BASE			/* switch to abort stack */
 1:
 	bl	1b				/* hang and never return */
 #else	/* !CONFIG_SPL_BUILD */
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index e16b088..7d50145 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -71,32 +71,6 @@ _vectors_end:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
index 5783df1..7404ea7 100644
--- a/arch/arm/cpu/arm_intcm/start.S
+++ b/arch/arm/cpu/arm_intcm/start.S
@@ -67,32 +67,6 @@ _fiq:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
index 6f7261b..78577b1 100644
--- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S
+++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S
@@ -17,9 +17,6 @@
 #include <asm/arch/clocks_omap3.h>
 #include <linux/linkage.h>
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE	/* sdram load addr from config.mk */
-
 #ifdef CONFIG_SPL_BUILD
 ENTRY(save_boot_params)
 	ldr	r4, =omap3_boot_device
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 6c9b11a..4ff6268 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -63,29 +63,6 @@ _end_vect:
  *
  *************************************************************************/
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S
index 82c868a..80ef443 100644
--- a/arch/arm/cpu/ixp/start.S
+++ b/arch/arm/cpu/ixp/start.S
@@ -80,32 +80,6 @@ _fiq:			.word fiq
  * - jump to second stage
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
index d8fb812..ae0d13c 100644
--- a/arch/arm/cpu/pxa/start.S
+++ b/arch/arm/cpu/pxa/start.S
@@ -84,32 +84,6 @@ _end_vect:
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
@@ -316,7 +290,6 @@ cpu_init_crit:
 #ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
-	ldr	sp, _TEXT_BASE			/* use 32 words about stack */
 	bl	hang				/* hang and never return */
 #else	/* !CONFIG_SPL_BUILD */
 	.align	5
diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
index 27bcda5..bf80937 100644
--- a/arch/arm/cpu/sa1100/start.S
+++ b/arch/arm/cpu/sa1100/start.S
@@ -56,32 +56,6 @@ _fiq:			.word fiq
  *************************************************************************
  */
 
-.globl _TEXT_BASE
-_TEXT_BASE:
-#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_TEXT_BASE)
-	.word	CONFIG_SPL_TEXT_BASE
-#else
-	.word	CONFIG_SYS_TEXT_BASE
-#endif
-
-/*
- * These are defined in the board-specific linker script.
- * Subtracting _start from them lets the linker put their
- * relative position in the executable instead of leaving
- * them null.
- */
-.globl _bss_start_ofs
-_bss_start_ofs:
-	.word __bss_start - _start
-
-.globl _bss_end_ofs
-_bss_end_ofs:
-	.word __bss_end - _start
-
-.globl _end_ofs
-_end_ofs:
-	.word _end - _start
-
 #ifdef CONFIG_USE_IRQ
 /* IRQ stack memory (calculated at run-time) */
 .globl IRQ_STACK_START
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index b770e25..a16d32c 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -105,8 +105,8 @@ static int display_banner(void)
 {
 	printf("\n\n%s\n\n", version_string);
 	debug("U-Boot code: %08lX -> %08lX  BSS: -> %08lX\n",
-	       _TEXT_BASE,
-	       _bss_start_ofs + _TEXT_BASE, _bss_end_ofs + _TEXT_BASE);
+	       (ulong)&_start,
+	       (ulong)&__bss_start, (ulong)&__bss_end);
 #ifdef CONFIG_MODEM_SUPPORT
 	debug("Modem Support enabled\n");
 #endif
@@ -277,13 +277,13 @@ void board_init_f(ulong bootflag)
 
 	memset((void *)gd, 0, sizeof(gd_t));
 
-	gd->mon_len = _bss_end_ofs;
+	gd->mon_len = (ulong)&__bss_end - (ulong)_start;
 #ifdef CONFIG_OF_EMBED
 	/* Get a pointer to the FDT */
 	gd->fdt_blob = _binary_dt_dtb_start;
 #elif defined CONFIG_OF_SEPARATE
 	/* FDT is at end of image */
-	gd->fdt_blob = (void *)(_end_ofs + _TEXT_BASE);
+	gd->fdt_blob = &_end;
 #endif
 	/* Allow the early environment to override the fdt address */
 	gd->fdt_blob = (void *)getenv_ulong("fdtcontroladdr", 16,
@@ -455,7 +455,7 @@ void board_init_f(ulong bootflag)
 
 	gd->relocaddr = addr;
 	gd->start_addr_sp = addr_sp;
-	gd->reloc_off = addr - _TEXT_BASE;
+	gd->reloc_off = addr - (ulong)&_start;
 	debug("relocation Offset is: %08lx\n", gd->reloc_off);
 	if (new_fdt) {
 		memcpy(new_fdt, gd->fdt_blob, fdt_size);
@@ -520,7 +520,7 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	gd->flags |= GD_FLG_RELOC;	/* tell others: relocation done */
 	bootstage_mark_name(BOOTSTAGE_ID_START_UBOOT_R, "board_init_r");
 
-	monitor_flash_len = _end_ofs;
+	monitor_flash_len = (ulong)&__rel_dyn_end - (ulong)_start;
 
 	/* Enable caches */
 	enable_caches();
diff --git a/board/armltd/integrator/lowlevel_init.S b/board/armltd/integrator/lowlevel_init.S
index 389d5e9..0fb42ad 100644
--- a/board/armltd/integrator/lowlevel_init.S
+++ b/board/armltd/integrator/lowlevel_init.S
@@ -183,7 +183,7 @@ cm_remap:
 
 	/* Now 0x00000000 is writeable, replace the vectors	*/
 	ldr	r0, =_start	/* r0 <- start of vectors	*/
-	ldr	r2, =_TEXT_BASE	/* r2 <- past vectors	*/
+	add	r2, r0, #64	/* r2 <- past vectors	*/
 	sub	r1,r1,r1		/* destination 0x00000000	*/
 
 copy_vec:
diff --git a/board/cm4008/flash.c b/board/cm4008/flash.c
index 2511928..8315a57 100644
--- a/board/cm4008/flash.c
+++ b/board/cm4008/flash.c
@@ -57,7 +57,7 @@ unsigned long flash_init (void)
 	 */
 	flash_protect (FLAG_PROTECT_SET,
 		       CONFIG_SYS_FLASH_BASE,
-		       CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
+		       CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start),
 		       &flash_info[0]);
 
 	return size;
diff --git a/board/cm41xx/flash.c b/board/cm41xx/flash.c
index 2511928..8315a57 100644
--- a/board/cm41xx/flash.c
+++ b/board/cm41xx/flash.c
@@ -57,7 +57,7 @@ unsigned long flash_init (void)
 	 */
 	flash_protect (FLAG_PROTECT_SET,
 		       CONFIG_SYS_FLASH_BASE,
-		       CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
+		       CONFIG_SYS_FLASH_BASE + (__bss_end - __bss_start),
 		       &flash_info[0]);
 
 	return size;
diff --git a/board/mpl/vcma9/lowlevel_init.S b/board/mpl/vcma9/lowlevel_init.S
index b889cf9..cca9c0c 100644
--- a/board/mpl/vcma9/lowlevel_init.S
+++ b/board/mpl/vcma9/lowlevel_init.S
@@ -197,13 +197,10 @@
 #define REFCNT_266		0
 /**************************************/
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 .globl lowlevel_init
 lowlevel_init:
 	/* use r0 to relocate DATA read/write to flash rather than memory ! */
-	ldr	r0, _TEXT_BASE
+	ldr	r0, =CONFIG_SYS_TEXT_BASE
 	ldr	r13, =BWSCON
 
 	/* enable minimal access to PLD */
diff --git a/board/samsung/goni/lowlevel_init.S b/board/samsung/goni/lowlevel_init.S
index 726211a..d52bc09 100644
--- a/board/samsung/goni/lowlevel_init.S
+++ b/board/samsung/goni/lowlevel_init.S
@@ -22,9 +22,6 @@
  * r9 has Mobile DDR size, 1 means 1GiB, 2 means 2GiB and so on
  */
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 	.globl lowlevel_init
 lowlevel_init:
 	mov	r11, lr
diff --git a/board/samsung/smdk2410/lowlevel_init.S b/board/samsung/smdk2410/lowlevel_init.S
index c7b78fd..5de04f1 100644
--- a/board/samsung/smdk2410/lowlevel_init.S
+++ b/board/samsung/smdk2410/lowlevel_init.S
@@ -110,16 +110,13 @@
 #define REFCNT			1113	/* period=15.6us, HCLK=60Mhz, (2048+1-15.6*60) */
 /**************************************/
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 .globl lowlevel_init
 lowlevel_init:
 	/* memory control configuration */
 	/* make r0 relative the current location so that it */
 	/* reads SMRDATA out of FLASH rather than memory ! */
 	ldr     r0, =SMRDATA
-	ldr	r1, _TEXT_BASE
+	ldr	r1, =CONFIG_SYS_TEXT_BASE
 	sub	r0, r0, r1
 	ldr	r1, =BWSCON	/* Bus Width Status Controller */
 	add     r2, r0, #13*4
diff --git a/board/samsung/smdk5250/lowlevel_init.S b/board/samsung/smdk5250/lowlevel_init.S
index 9003e2d..8e389cc 100644
--- a/board/samsung/smdk5250/lowlevel_init.S
+++ b/board/samsung/smdk5250/lowlevel_init.S
@@ -10,9 +10,6 @@
 #include <version.h>
 #include <asm/arch/cpu.h>
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 	.globl lowlevel_init
 lowlevel_init:
 
@@ -47,7 +44,7 @@ lowlevel_init:
 	ldr	r0, =0x0ffffff		/* r0 <- Mask Bits*/
 	bic	r1, pc, r0		/* pc <- current addr of code */
 					/* r1 <- unmasked bits of pc */
-	ldr	r2, _TEXT_BASE		/* r2 <- original base addr in ram */
+	ldr	r2, =CONFIG_SYS_TEXT_BASE /* r2 <- original base addr in ram */
 	bic	r2, r2, r0		/* r2 <- unmasked bits of r2*/
 	cmp	r1, r2			/* compare r1, r2 */
 	beq	1f			/* r0 == r1 then skip sdram init */
diff --git a/board/samsung/smdkc100/lowlevel_init.S b/board/samsung/smdkc100/lowlevel_init.S
index 4df0974..65e6b7a 100644
--- a/board/samsung/smdkc100/lowlevel_init.S
+++ b/board/samsung/smdkc100/lowlevel_init.S
@@ -17,9 +17,6 @@
  * r5 has zero always
  */
 
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE
-
 	.globl lowlevel_init
 lowlevel_init:
 	mov	r9, lr
diff --git a/board/ti/omap5912osk/lowlevel_init.S b/board/ti/omap5912osk/lowlevel_init.S
index cad0a5a..e05a1c7 100644
--- a/board/ti/omap5912osk/lowlevel_init.S
+++ b/board/ti/omap5912osk/lowlevel_init.S
@@ -18,10 +18,6 @@
 #include <./configs/omap1510.h>
 #endif
 
-
-_TEXT_BASE:
-	.word	CONFIG_SYS_TEXT_BASE	/* sdram load addr from config.mk */
-
 .globl lowlevel_init
 lowlevel_init:
 
diff --git a/common/board_f.c b/common/board_f.c
index aa70c3e..84b5cf9 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -149,13 +149,9 @@ static int display_text_info(void)
 #ifndef CONFIG_SANDBOX
 	ulong bss_start, bss_end;
 
-#ifdef CONFIG_SYS_SYM_OFFSETS
-	bss_start = _bss_start_ofs + _TEXT_BASE;
-	bss_end = _bss_end_ofs + _TEXT_BASE;
-#else
 	bss_start = (ulong)&__bss_start;
 	bss_end = (ulong)&__bss_end;
-#endif
+
 	debug("U-Boot code: %08X -> %08lX  BSS: -> %08lX\n",
 	      CONFIG_SYS_TEXT_BASE, bss_start, bss_end);
 #endif
@@ -279,8 +275,8 @@ static int zero_global_data(void)
 
 static int setup_mon_len(void)
 {
-#ifdef CONFIG_SYS_SYM_OFFSETS
-	gd->mon_len = _bss_end_ofs;
+#ifdef __ARM__
+	gd->mon_len = (ulong)&__bss_end - (ulong)_start;
 #elif defined(CONFIG_SANDBOX)
 	gd->mon_len = (ulong)&_end - (ulong)_init;
 #else
@@ -363,11 +359,7 @@ static int setup_fdt(void)
 	gd->fdt_blob = _binary_dt_dtb_start;
 #elif defined CONFIG_OF_SEPARATE
 	/* FDT is at end of image */
-# ifdef CONFIG_SYS_SYM_OFFSETS
-	gd->fdt_blob = (void *)(_end_ofs + CONFIG_SYS_TEXT_BASE);
-# else
 	gd->fdt_blob = (ulong *)&_end;
-# endif
 #elif defined(CONFIG_OF_HOSTFILE)
 	if (read_fdt_from_file()) {
 		puts("Failed to read control FDT\n");
diff --git a/common/board_r.c b/common/board_r.c
index c2d0763..899f377 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -128,8 +128,8 @@ __weak int fixup_cpu(void)
 
 static int initr_reloc_global_data(void)
 {
-#ifdef CONFIG_SYS_SYM_OFFSETS
-	monitor_flash_len = _end_ofs;
+#ifdef __ARM__
+	monitor_flash_len = _end - __image_copy_start;
 #elif !defined(CONFIG_SANDBOX)
 	monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
 #endif
diff --git a/include/asm-generic/sections.h b/include/asm-generic/sections.h
index 7e1eb4b..458952f 100644
--- a/include/asm-generic/sections.h
+++ b/include/asm-generic/sections.h
@@ -63,28 +63,16 @@ extern char __image_copy_end[];
 extern void _start(void);
 
 /*
- * ARM needs to use offsets for symbols, since the values of some symbols
- * are not resolved prior to relocation (and are just 0). Maybe this can be
- * resolved, or maybe other architectures are similar, iwc this should be
- * promoted to an architecture option.
+ * ARM defines its symbols as char[]. Other arches define them as ulongs.
  */
 #ifdef CONFIG_ARM
-#define CONFIG_SYS_SYM_OFFSETS
-#endif
-
-#ifdef CONFIG_SYS_SYM_OFFSETS
-/* Start/end of the relocation entries, as an offset from _start */
-extern ulong _rel_dyn_start_ofs;
-extern ulong _rel_dyn_end_ofs;
-
-/* End of the region to be relocated, as an offset form _start */
-extern ulong _image_copy_end_ofs;
 
-extern ulong _bss_start_ofs;	/* BSS start relative to _start */
-extern ulong _bss_end_ofs;		/* BSS end relative to _start */
-extern ulong _end_ofs;		/* end of image relative to _start */
-
-extern ulong _TEXT_BASE;	/* code start */
+extern char __bss_start[];
+extern char __bss_end[];
+extern char __image_copy_start[];
+extern char __image_copy_end[];
+extern char __rel_dyn_start[];
+extern char __rel_dyn_end[];
 
 #else /* don't use offsets: */
 
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated
  2014-01-30 10:02       ` [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated Albert ARIBAUD
  2014-01-30 10:02         ` [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE Albert ARIBAUD
@ 2014-01-30 12:09         ` Benoît Thébaudeau
  2014-02-13 10:44           ` Albert ARIBAUD
  1 sibling, 1 reply; 12+ messages in thread
From: Benoît Thébaudeau @ 2014-01-30 12:09 UTC (permalink / raw)
  To: u-boot

Hi Albert,

On Thursday, January 30, 2014 11:02:46 AM, Albert ARIBAUD wrote:
> This prevents references to _end from generating absolute
> relocation records.
> 
> This change is binary invariant for ARM targets.
> 
> Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> 
> Changes in v5:
> - Rebase onto u-boot-arm/master
> 
> Changes in v4: None
> Changes in v3:
> - Replace _end in linker scripts with _image_binary_end
> 
> Changes in v2: None

[...]

> diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
> index 4da5d24..f61ef50 100644
> --- a/arch/arm/cpu/u-boot.lds
> +++ b/arch/arm/cpu/u-boot.lds
> @@ -60,7 +60,12 @@ SECTIONS
>  		*(.__rel_dyn_end)
>  	}
>  
> -	_end = .;
> +	.end :
> +	{
> +		*(.__end)
> +	}
> +
> +	_image_binary_end = .;
>  
>  	/*
>  	 * Deprecated: this MMU section is used by pxa at present but
> @@ -91,7 +96,9 @@ SECTIONS
>  		KEEP(*(.__bss_end));
>  	}
>  
> -	.dynsym _end : { *(.dynsym) }
> +	.dynsym _image_binary_end : { *(.dynsym) }
> +	.hash : { *(.hash) }
> +	.got.plt : { *(.got.plt) }

Are the two additions above intentional? These lines were present in the context
in v4, but not as an addition. They are also unrelated to the topic of this
patch.

>  	.dynbss : { *(.dynbss) }
>  	.dynstr : { *(.dynstr*) }
>  	.dynamic : { *(.dynamic*) }

[...]

Best regards,
Beno?t

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated
  2014-01-30 12:09         ` [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated Benoît Thébaudeau
@ 2014-02-13 10:44           ` Albert ARIBAUD
  0 siblings, 0 replies; 12+ messages in thread
From: Albert ARIBAUD @ 2014-02-13 10:44 UTC (permalink / raw)
  To: u-boot

Hi Beno?t,

On Thu, 30 Jan 2014 13:09:03 +0100 (CET), Beno?t Th?baudeau
<benoit.thebaudeau@advansee.com> wrote:

> Hi Albert,
> 
> On Thursday, January 30, 2014 11:02:46 AM, Albert ARIBAUD wrote:
> > This prevents references to _end from generating absolute
> > relocation records.
> > 
> > This change is binary invariant for ARM targets.
> > 
> > Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
> > ---
> > 
> > Changes in v5:
> > - Rebase onto u-boot-arm/master
> > 
> > Changes in v4: None
> > Changes in v3:
> > - Replace _end in linker scripts with _image_binary_end
> > 
> > Changes in v2: None
> 
> [...]
> 
> > diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
> > index 4da5d24..f61ef50 100644
> > --- a/arch/arm/cpu/u-boot.lds
> > +++ b/arch/arm/cpu/u-boot.lds
> > @@ -60,7 +60,12 @@ SECTIONS
> >  		*(.__rel_dyn_end)
> >  	}
> >  
> > -	_end = .;
> > +	.end :
> > +	{
> > +		*(.__end)
> > +	}
> > +
> > +	_image_binary_end = .;
> >  
> >  	/*
> >  	 * Deprecated: this MMU section is used by pxa at present but
> > @@ -91,7 +96,9 @@ SECTIONS
> >  		KEEP(*(.__bss_end));
> >  	}
> >  
> > -	.dynsym _end : { *(.dynsym) }
> > +	.dynsym _image_binary_end : { *(.dynsym) }
> > +	.hash : { *(.hash) }
> > +	.got.plt : { *(.got.plt) }
> 
> Are the two additions above intentional? These lines were present in the context
> in v4, but not as an addition. They are also unrelated to the topic of this
> patch.

That's a mistake of mine; they should not have been added back. Thanks
for spotting this, v6 under test right now.

> Best regards,
> Beno?t

Amicalement,
-- 
Albert.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE
  2014-01-30 10:02         ` [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE Albert ARIBAUD
@ 2014-02-14  4:30           ` Minkyu Kang
  2014-02-14  7:28             ` Rajeshwari Birje
  0 siblings, 1 reply; 12+ messages in thread
From: Minkyu Kang @ 2014-02-14  4:30 UTC (permalink / raw)
  To: u-boot

On 30/01/14 19:02, Albert ARIBAUD wrote:
> Remove the last uses of symbol offsets in ARM U-Boot.
> Remove some needless uses of _TEXT_BASE.
> Remove all _TEXT_BASE definitions.
> 
> Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> 
> Changes in v5: None
> Changes in v4:
> - removed mkexynosspl patch, already fixed in 0fcac1ab
> 
> Changes in v3: None
> Changes in v2:
> - fixed use of _rel_dyn_end instead of _end
> 
>  README                                      |  6 ------
>  arch/arm/cpu/arm1136/start.S                | 27 ---------------------------
>  arch/arm/cpu/arm1176/start.S                | 27 ---------------------------
>  arch/arm/cpu/arm720t/start.S                | 26 --------------------------
>  arch/arm/cpu/arm920t/start.S                | 26 --------------------------
>  arch/arm/cpu/arm926ejs/at91/lowlevel_init.S | 14 +-------------
>  arch/arm/cpu/arm926ejs/mxs/start.S          | 27 ---------------------------
>  arch/arm/cpu/arm926ejs/start.S              | 27 ---------------------------
>  arch/arm/cpu/arm946es/start.S               | 26 --------------------------
>  arch/arm/cpu/arm_intcm/start.S              | 26 --------------------------
>  arch/arm/cpu/armv7/omap3/lowlevel_init.S    |  3 ---
>  arch/arm/cpu/armv7/start.S                  | 23 -----------------------
>  arch/arm/cpu/ixp/start.S                    | 26 --------------------------
>  arch/arm/cpu/pxa/start.S                    | 27 ---------------------------
>  arch/arm/cpu/sa1100/start.S                 | 26 --------------------------
>  arch/arm/lib/board.c                        | 12 ++++++------
>  board/armltd/integrator/lowlevel_init.S     |  2 +-
>  board/cm4008/flash.c                        |  2 +-
>  board/cm41xx/flash.c                        |  2 +-
>  board/mpl/vcma9/lowlevel_init.S             |  5 +----
>  board/samsung/goni/lowlevel_init.S          |  3 ---
>  board/samsung/smdk2410/lowlevel_init.S      |  5 +----
>  board/samsung/smdk5250/lowlevel_init.S      |  5 +----
>  board/samsung/smdkc100/lowlevel_init.S      |  3 ---
>  board/ti/omap5912osk/lowlevel_init.S        |  4 ----
>  common/board_f.c                            | 14 +++-----------
>  common/board_r.c                            |  4 ++--
>  include/asm-generic/sections.h              | 26 +++++++-------------------
>  28 files changed, 25 insertions(+), 399 deletions(-)
> 

About samsung boards,

Acked-by: Minkyu Kang <mk7.kang@samsung.com>

Thanks,
Minkyu Kang.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE
  2014-02-14  4:30           ` Minkyu Kang
@ 2014-02-14  7:28             ` Rajeshwari Birje
  2014-02-14  8:08               ` Albert ARIBAUD
  0 siblings, 1 reply; 12+ messages in thread
From: Rajeshwari Birje @ 2014-02-14  7:28 UTC (permalink / raw)
  To: u-boot

Hi All,

For exynos5250 board we use CONFIG_SKIP_LOWLEVEL_INIT, hence change in
"board/samsung/smdk5250/lowlevel_init.S" should not effect. Infact I
feel that file can be removed.


Regards,
Rajeshwari

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE
  2014-02-14  7:28             ` Rajeshwari Birje
@ 2014-02-14  8:08               ` Albert ARIBAUD
  2014-02-14  8:22                 ` Rajeshwari Birje
  0 siblings, 1 reply; 12+ messages in thread
From: Albert ARIBAUD @ 2014-02-14  8:08 UTC (permalink / raw)
  To: u-boot

Hi Rajeshwari,

On Fri, 14 Feb 2014 12:58:58 +0530, Rajeshwari Birje
<rajeshwari.birje@gmail.com> wrote:

> Hi All,
> 
> For exynos5250 board we use CONFIG_SKIP_LOWLEVEL_INIT, hence change in
> "board/samsung/smdk5250/lowlevel_init.S" should not effect. Infact I
> feel that file can be removed.

If so then please post a separate patch for this removal, which is
logically unrelated to removing  symbol offsets.

> Regards,
> Rajeshwari

Amicalement,
-- 
Albert.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE
  2014-02-14  8:08               ` Albert ARIBAUD
@ 2014-02-14  8:22                 ` Rajeshwari Birje
  0 siblings, 0 replies; 12+ messages in thread
From: Rajeshwari Birje @ 2014-02-14  8:22 UTC (permalink / raw)
  To: u-boot

Hi Albert,

On Fri, Feb 14, 2014 at 1:38 PM, Albert ARIBAUD
<albert.u.boot@aribaud.net> wrote:
> Hi Rajeshwari,
>
> On Fri, 14 Feb 2014 12:58:58 +0530, Rajeshwari Birje
> <rajeshwari.birje@gmail.com> wrote:
>
>> Hi All,
>>
>> For exynos5250 board we use CONFIG_SKIP_LOWLEVEL_INIT, hence change in
>> "board/samsung/smdk5250/lowlevel_init.S" should not effect. Infact I
>> feel that file can be removed.
>
> If so then please post a separate patch for this removal, which is
> logically unrelated to removing  symbol offsets.
Yes will do that.

-- 
Regards,
Rajeshwari Shinde
>
>> Regards,
>> Rajeshwari
>
> Amicalement,
> --
> Albert.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-02-14  8:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-08  8:57 [U-Boot] [PATCH v4 1/3] cm_t335: fix linker file to produce full ELF Albert ARIBAUD
2014-01-08  8:57 ` [U-Boot] [PATCH v4 2/3] arm: make _end compiler-generated Albert ARIBAUD
2014-01-08  8:57   ` [U-Boot] [PATCH v4 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE Albert ARIBAUD
2014-01-30 10:02     ` [U-Boot] [PATCH v5 1/3] cm_t335: fix linker file to produce full ELF Albert ARIBAUD
2014-01-30 10:02       ` [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated Albert ARIBAUD
2014-01-30 10:02         ` [U-Boot] [PATCH v5 3/3] arm: remove unneeded symbol offsets and _TEXT_BASE Albert ARIBAUD
2014-02-14  4:30           ` Minkyu Kang
2014-02-14  7:28             ` Rajeshwari Birje
2014-02-14  8:08               ` Albert ARIBAUD
2014-02-14  8:22                 ` Rajeshwari Birje
2014-01-30 12:09         ` [U-Boot] [PATCH v5 2/3] arm: make _end compiler-generated Benoît Thébaudeau
2014-02-13 10:44           ` Albert ARIBAUD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.