From patchwork Sat Feb 9 20:33:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot, v1, 1/7] MIPS: u-boot.lds: merge all BSS sections and introduce symbols __bss_[start|end] Date: Sat, 09 Feb 2013 10:33:24 -0000 From: Daniel Schwierzeck X-Patchwork-Id: 219437 Message-Id: <1360442010-7520-2-git-send-email-daniel.schwierzeck@gmail.com> To: u-boot@lists.denx.de Cc: Zhi-zhou Zhang From: Daniel Schwierzeck These symbols are used in later patches for as addresses for clearing the BSS area in the relocated U-Boot image. Signed-off-by: Daniel Schwierzeck --- arch/mips/cpu/u-boot.lds | 11 ++++++----- arch/mips/include/asm/u-boot-mips.h | 12 ++++++++++++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/arch/mips/cpu/u-boot.lds b/arch/mips/cpu/u-boot.lds index 58a49b2..6980b86 100644 --- a/arch/mips/cpu/u-boot.lds +++ b/arch/mips/cpu/u-boot.lds @@ -70,13 +70,14 @@ SECTIONS uboot_end_data = .; . = ALIGN(4); - .sbss : { - *(.sbss*) - } - .bss : { - *(.bss*) + __bss_start = .; + *(.sbss.*) + *(.bss.*) + *(COMMON) . = ALIGN(4); + __bss_end = .; } + uboot_end = .; } diff --git a/arch/mips/include/asm/u-boot-mips.h b/arch/mips/include/asm/u-boot-mips.h index 6f26dfa..eda0498 100644 --- a/arch/mips/include/asm/u-boot-mips.h +++ b/arch/mips/include/asm/u-boot-mips.h @@ -8,4 +8,16 @@ extern ulong uboot_end_data; extern ulong uboot_end; +static inline unsigned long bss_start(void) +{ + extern ulong __bss_start; + return (unsigned long) &__bss_start; +} + +static inline unsigned long bss_end(void) +{ + extern ulong __bss_end; + return (unsigned long) &__bss_end; +} + extern int incaip_set_cpuclk(void);