From 64134f011254123618798ff77c42ba196b2ec485 Mon Sep 17 00:00:00 2001 From: Wolfgang Denk Date: Sat, 12 Jan 2008 20:31:39 +0100 Subject: Fix linker scripts: add NOLOAD atribute to .bss/.sbss sections With recent toolchain versions, some boards would not build because or errors like this one (here for ocotea board when building with ELDK 4.2 beta): ppc_4xx-ld: section .bootpg [fffff000 -> fffff23b] overlaps section .bss [fffee900 -> fffff8ab] For many boards, the .bss section is big enough that it wraps around at the end of the address space (0xFFFFFFFF), so the problem will not be visible unless you use a 64 bit tool chain for development. On some boards however, changes to the code size (due to different optimizations) we bail out with section overlaps like above. The fix is to add the NOLOAD attribute to the .bss and .sbss sections, telling the linker that .bss does not consume any space in the image. Signed-off-by: Wolfgang Denk --- examples/mips.lds | 4 ++-- examples/nios.lds | 2 +- examples/nios2.lds | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/mips.lds b/examples/mips.lds index a7707287a2..aceb6e9002 100644 --- a/examples/mips.lds +++ b/examples/mips.lds @@ -52,8 +52,8 @@ SECTIONS . = ALIGN(4); __bss_start = .; - .sbss : { *(.sbss) } - .bss : { *(.bss) } + .sbss (NOLOAD) : { *(.sbss) } + .bss (NOLOAD) : { *(.bss) } _end = .; } diff --git a/examples/nios.lds b/examples/nios.lds index dd5bfad7b1..18072f71b1 100644 --- a/examples/nios.lds +++ b/examples/nios.lds @@ -51,7 +51,7 @@ SECTIONS __bss_start = .; . = ALIGN(4); - .bss : + .bss (NOLOAD) : { *(.bss) } diff --git a/examples/nios2.lds b/examples/nios2.lds index 277a0a7a67..6a100dc2f7 100644 --- a/examples/nios2.lds +++ b/examples/nios2.lds @@ -74,7 +74,7 @@ SECTIONS * bss follows. We keep it adjacent to simplify init code. */ __bss_start = .; - .sbss : + .sbss (NOLOAD) : { *(.sbss) *(.sbss.*) @@ -82,7 +82,7 @@ SECTIONS *(.scommon) } . = ALIGN(4); - .bss : + .bss (NOLOAD) : { *(.bss) *(.bss.*) -- cgit v1.2.3