[U-Boot] [PATCH 2/2] 85xx: Ensure BSS segment doesn't start at address 0x0

Peter Tyser ptyser at xes-inc.com
Tue Oct 6 01:01:10 CEST 2009


When U-Boot is relocated from flash to RAM pointers are modified
accordingly.  However, pointers initialzed with NULL values should not
be modified so that they maintain their intended NULL value.  The
address of the BSS segment must be modified during relocation which
means that it must not have a NULL value.

Signed-off-by: Peter Tyser <ptyser at xes-inc.com>
---
 cpu/mpc85xx/u-boot.lds.S |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/cpu/mpc85xx/u-boot.lds.S b/cpu/mpc85xx/u-boot.lds.S
index a347cd1..ef3de66 100644
--- a/cpu/mpc85xx/u-boot.lds.S
+++ b/cpu/mpc85xx/u-boot.lds.S
@@ -131,6 +131,14 @@ SECTIONS
 
   . = RESET_VECTOR_ADDRESS + 0x4;
 
+  /*
+   * Make sure that the bss segment doesn't start at 0x0, otherwise its
+   * address won't be updated during relocation fixups
+   */
+#if !((RESET_VECTOR_ADDRESS + 0x4) & 0xffffffff)
+  . |= 0x10;
+#endif
+
   __bss_start = .;
   .bss (NOLOAD)       :
   {
-- 
1.6.2.1



More information about the U-Boot mailing list