[U-Boot] [PATCH v1 5/7] MIPS: start.S: use symbol __image_copy_end for U-Boot image relocation

daniel.schwierzeck at gmail.com daniel.schwierzeck at gmail.com
Sat Feb 9 21:33:28 CET 2013


From: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>

Use the newly introduced symbol __image_copy_end as end address for
relocation of U-Boot image. This is needed for dynamic relocation added
in later patches. This patch obsoletes the symbols uboot_end and
uboot_end_data which are removed.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck at gmail.com>
---
 arch/mips/cpu/mips32/start.S        | 7 +++----
 arch/mips/cpu/mips64/start.S        | 7 +++----
 arch/mips/cpu/u-boot.lds            | 4 ----
 arch/mips/cpu/xburst/start.S        | 7 +++----
 arch/mips/include/asm/u-boot-mips.h | 3 ---
 5 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/arch/mips/cpu/mips32/start.S b/arch/mips/cpu/mips32/start.S
index cd8b914..649c0bb 100644
--- a/arch/mips/cpu/mips32/start.S
+++ b/arch/mips/cpu/mips32/start.S
@@ -173,7 +173,7 @@ relocate_code:
 	sub	s1, s2, t0		# s1 <-- relocation offset
 
 	la	t3, in_ram
-	lw	t2, -12(t3)		# t2 <-- uboot_end_data
+	lw	t2, -12(t3)		# t2 <-- __image_copy_end
 	move	t1, a2
 
 	add	gp, s1			# adjust gp
@@ -201,9 +201,8 @@ relocate_code:
 	jr	t0
 	 nop
 
+	.word	__image_copy_end
 	.word	_GLOBAL_OFFSET_TABLE_
-	.word	uboot_end_data
-	.word	uboot_end
 	.word	num_got_entries
 
 in_ram:
@@ -214,7 +213,7 @@ in_ram:
 	 * generated by GNU ld. Skip these reserved entries from relocation.
 	 */
 	lw	t3, -4(t0)		# t3 <-- num_got_entries
-	lw	t4, -16(t0)		# t4 <-- _GLOBAL_OFFSET_TABLE_
+	lw	t4, -8(t0)		# t4 <-- _GLOBAL_OFFSET_TABLE_
 	add	t4, s1			# t4 now holds relocated _G_O_T_
 	addi	t4, t4, 8		# skipping first two entries
 	li	t2, 2
diff --git a/arch/mips/cpu/mips64/start.S b/arch/mips/cpu/mips64/start.S
index ba4ca4d..5c2c7b5 100644
--- a/arch/mips/cpu/mips64/start.S
+++ b/arch/mips/cpu/mips64/start.S
@@ -165,7 +165,7 @@ relocate_code:
 	dsub	s1, s2, t0		# s1 <-- relocation offset
 
 	dla	t3, in_ram
-	ld	t2, -24(t3)		# t2 <-- uboot_end_data
+	ld	t2, -24(t3)		# t2 <-- __image_copy_end
 	move	t1, a2
 
 	dadd	gp, s1			# adjust gp
@@ -193,9 +193,8 @@ relocate_code:
 	jr	t0
 	 nop
 
+	.dword	__image_copy_end
 	.dword	_GLOBAL_OFFSET_TABLE_
-	.dword	uboot_end_data
-	.dword	uboot_end
 	.dword	num_got_entries
 
 in_ram:
@@ -206,7 +205,7 @@ in_ram:
 	 * generated by GNU ld. Skip these reserved entries from relocation.
 	 */
 	ld	t3, -8(t0)		# t3 <-- num_got_entries
-	ld	t8, -32(t0)		# t8 <-- _GLOBAL_OFFSET_TABLE_
+	ld	t8, -16(t0)		# t8 <-- _GLOBAL_OFFSET_TABLE_
 	dadd	t8, s1			# t8 now holds relocated _G_O_T_
 	daddi	t8, t8, 16		# skipping first two entries
 	dli	t2, 2
diff --git a/arch/mips/cpu/u-boot.lds b/arch/mips/cpu/u-boot.lds
index 7b5fca0..4cd983a 100644
--- a/arch/mips/cpu/u-boot.lds
+++ b/arch/mips/cpu/u-boot.lds
@@ -67,8 +67,6 @@ SECTIONS
 		#include <u-boot.lst>
 	}
 
-	uboot_end_data = .;
-
 	. = ALIGN(4);
 	__image_copy_end = .;
 
@@ -80,6 +78,4 @@ SECTIONS
 		. = ALIGN(4);
 		__bss_end = .;
 	}
-
-	uboot_end = .;
 }
diff --git a/arch/mips/cpu/xburst/start.S b/arch/mips/cpu/xburst/start.S
index bd9390a..6b30d3e 100644
--- a/arch/mips/cpu/xburst/start.S
+++ b/arch/mips/cpu/xburst/start.S
@@ -67,7 +67,7 @@ relocate_code:
 	sub	t6, a2, t0		# t6 <-- relocation offset
 
 	la	t3, in_ram
-	lw	t2, -12(t3)		# t2 <-- uboot_end_data
+	lw	t2, -12(t3)		# t2 <-- __image_copy_end
 	move	t1, a2
 
 	add	gp, t6			# adjust gp
@@ -116,9 +116,8 @@ relocate_code:
 	jr	t0
 	 nop
 
+	.word	__image_copy_end
 	.word	_GLOBAL_OFFSET_TABLE_
-	.word	uboot_end_data
-	.word	uboot_end
 	.word	num_got_entries
 
 in_ram:
@@ -129,7 +128,7 @@ in_ram:
 	 * generated by GNU ld. Skip these reserved entries from relocation.
 	 */
 	lw	t3, -4(t0)		# t3 <-- num_got_entries
-	lw	t4, -16(t0)		# t4 <-- _GLOBAL_OFFSET_TABLE_
+	lw	t4, -8(t0)		# t4 <-- _GLOBAL_OFFSET_TABLE_
 	add	t4, t6			# t4 now holds relocated _G_O_T_
 	addi	t4, t4, 8		# skipping first two entries
 	li	t2, 2
diff --git a/arch/mips/include/asm/u-boot-mips.h b/arch/mips/include/asm/u-boot-mips.h
index bfb6a4a..a483166 100644
--- a/arch/mips/include/asm/u-boot-mips.h
+++ b/arch/mips/include/asm/u-boot-mips.h
@@ -5,9 +5,6 @@
  * Copyright (C) 2003 Wolfgang Denk, DENX Software Engineering, wd at denx.de
  */
 
-extern ulong uboot_end_data;
-extern ulong uboot_end;
-
 static inline unsigned long bss_start(void)
 {
 	extern ulong __bss_start;
-- 
1.8.1.1



More information about the U-Boot mailing list