Commit 64134f01 authored by Wolfgang Denk's avatar Wolfgang Denk

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: default avatarWolfgang Denk <wd@denx.de>
parent 3afac79e
......@@ -126,7 +126,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
_sbss = .;
*(.sbss) *(.scommon)
......
......@@ -142,7 +142,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -128,7 +128,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -126,7 +126,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -126,7 +126,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -130,7 +130,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -130,7 +130,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -130,7 +130,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -132,7 +132,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -112,7 +112,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -109,7 +109,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -51,6 +51,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -61,7 +61,7 @@ SECTIONS
__bss_start = .;
. = ALIGN(4);
.bss :
.bss (NOLOAD) :
{
*(.bss)
}
......
......@@ -61,7 +61,7 @@ SECTIONS
__bss_start = .;
. = ALIGN(4);
.bss :
.bss (NOLOAD) :
{
*(.bss)
}
......
......@@ -87,7 +87,7 @@ SECTIONS
* bss follows. We keep it adjacent to simplify init code.
*/
__bss_start = .;
.sbss :
.sbss (NOLOAD) :
{
*(.sbss)
*(.sbss.*)
......@@ -95,7 +95,7 @@ SECTIONS
*(.scommon)
}
. = ALIGN(4);
.bss :
.bss (NOLOAD) :
{
*(.bss)
*(.bss.*)
......
......@@ -87,7 +87,7 @@ SECTIONS
* bss follows. We keep it adjacent to simplify init code.
*/
__bss_start = .;
.sbss :
.sbss (NOLOAD) :
{
*(.sbss)
*(.sbss.*)
......@@ -95,7 +95,7 @@ SECTIONS
*(.scommon)
}
. = ALIGN(4);
.bss :
.bss (NOLOAD) :
{
*(.bss)
*(.bss.*)
......
......@@ -87,7 +87,7 @@ SECTIONS
* bss follows. We keep it adjacent to simplify init code.
*/
__bss_start = .;
.sbss :
.sbss (NOLOAD) :
{
*(.sbss)
*(.sbss.*)
......@@ -95,7 +95,7 @@ SECTIONS
*(.scommon)
}
. = ALIGN(4);
.bss :
.bss (NOLOAD) :
{
*(.bss)
*(.bss.*)
......
......@@ -124,7 +124,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -125,7 +125,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -124,7 +124,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -133,7 +133,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -125,7 +125,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -132,7 +132,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -129,7 +129,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -124,7 +124,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -125,7 +125,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -132,7 +132,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -125,7 +125,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -132,7 +132,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -124,7 +124,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -130,7 +130,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -125,7 +125,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -132,7 +132,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -126,7 +126,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -132,7 +132,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -132,7 +132,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -133,7 +133,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -58,6 +58,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -50,6 +50,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -53,6 +53,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -52,6 +52,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -71,7 +71,7 @@ SECTIONS
. = ALIGN(8);
_edata = .;
.bss : {
.bss (NOLOAD) : {
*(.bss)
*(.bss.*)
}
......
......@@ -135,7 +135,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -129,7 +129,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -51,6 +51,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -51,6 +51,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -51,6 +51,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -111,7 +111,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -52,6 +52,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -129,7 +129,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
_sbss = .;
*(.sbss) *(.scommon)
......
......@@ -117,7 +117,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -51,6 +51,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -141,7 +141,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -51,6 +51,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -142,7 +142,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -142,7 +142,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -51,6 +51,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -53,6 +53,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -136,7 +136,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -47,6 +47,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -47,6 +47,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -47,6 +47,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -64,7 +64,7 @@ SECTIONS
num_got_entries = (__got_end - __got_start) >> 2;
. = ALIGN(4);
.sbss : { *(.sbss) }
.bss : { *(.bss) }
.sbss (NOLOAD) : { *(.sbss) }
.bss (NOLOAD) : { *(.bss) }
uboot_end = .;
}
......@@ -51,6 +51,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -51,6 +51,6 @@ SECTIONS
. = ALIGN(4);
__bss_start = .;
.bss : { *(.bss) }
.bss (NOLOAD) : { *(.bss) }
_end = .;
}
......@@ -126,7 +126,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -126,7 +126,7 @@ SECTIONS
__init_end = .;
__bss_start = .;
.bss :
.bss (NOLOAD) :
{
*(.sbss) *(.scommon)
*(.dynbss)
......
......@@ -119,7 +119,7 @@ SECTIONS
__init_end = .;