diff options
author | Simon Glass <sjg@chromium.org> | 2011-07-31 07:33:23 +1200 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-09-14 21:55:43 -0700 |
commit | f23e5f319d6bcdd869571ddd96e01ec780806648 (patch) | |
tree | 5d952c552797d830c25516962fd84bc6887fbd1f | |
parent | 45943ddd690d6d5cc6778647543fd4efac89e7ab (diff) |
postload: Add new _reloc_end to define end of relocated area
Rather than __bss_end, define a new symbol which sets the end boundary of
code to be relocated by relocate_code(). This allows us to add code after
the BSS section which is still relocatable.
BUG=chromium-os:17053
TEST=build and boot U-Boot on seaboard
Change-Id: Ice784ee65ab8cbb7d2b996dc53c722c5dd9315c0
Reviewed-on: http://gerrit.chromium.org/gerrit/7660
Reviewed-by: Che-Liang Chiou <clchiou@chromium.org>
Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | arch/arm/cpu/armv7/start.S | 4 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/u-boot.lds | 3 | ||||
-rw-r--r-- | arch/arm/include/asm/u-boot-arm.h | 3 | ||||
-rw-r--r-- | arch/arm/lib/board.c | 2 |
4 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S index eafd7ee84d6..644337ebf64 100644 --- a/arch/arm/cpu/armv7/start.S +++ b/arch/arm/cpu/armv7/start.S @@ -81,6 +81,10 @@ _bss_start_ofs: _bss_end_ofs: .word __bss_end__ - _start +.globl _reloc_end_ofs +_reloc_end_ofs: + .word __reloc_end__ - _start + .globl _end_ofs _end_ofs: .word _end - _start diff --git a/arch/arm/cpu/armv7/u-boot.lds b/arch/arm/cpu/armv7/u-boot.lds index dbae54d4f8a..6c06ccb4607 100644 --- a/arch/arm/cpu/armv7/u-boot.lds +++ b/arch/arm/cpu/armv7/u-boot.lds @@ -75,6 +75,9 @@ SECTIONS __bss_end__ = .; } + /* We must relocate everything from the start to here */ + __reloc_end__ = .; + /DISCARD/ : { *(.dynstr*) } /DISCARD/ : { *(.dynamic*) } /DISCARD/ : { *(.plt*) } diff --git a/arch/arm/include/asm/u-boot-arm.h b/arch/arm/include/asm/u-boot-arm.h index f6091f45ba9..22d26b9e8f2 100644 --- a/arch/arm/include/asm/u-boot-arm.h +++ b/arch/arm/include/asm/u-boot-arm.h @@ -31,7 +31,8 @@ /* for the following variables, see start.S */ extern ulong _bss_start_ofs; /* BSS start relative to _start */ -extern ulong _bss_end_ofs; /* BSS end relative to _start */ +extern ulong _bss_end_ofs; /* BSS end relative to _start */ +extern ulong _reloc_end_ofs; /* end of relocate area relative to _start */ extern ulong _end_ofs; /* end of image relative to _start */ extern ulong IRQ_STACK_START; /* top of IRQ stack */ extern ulong FIQ_STACK_START; /* top of FIQ stack */ diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c index 5bcdf138309..460b68ae002 100644 --- a/arch/arm/lib/board.c +++ b/arch/arm/lib/board.c @@ -310,7 +310,7 @@ void board_init_f (ulong bootflag) memset ((void*)gd, 0, sizeof (gd_t)); - gd->mon_len = _bss_end_ofs; + gd->mon_len = _reloc_end_ofs; #ifdef CONFIG_OF_EMBED /* Get a pointer to the FDT */ gd->blob = _binary_dt_dtb_start; |