ARM: Fix __bss_start and __bss_end in linker scripts
Commit 3ebd1cbc
introduced compiler-generated __bss_start
and __bss_end__ and commit c23561e7 rewrote all __bss_end__
as __bss_end. Their merge caused silent and harmless but
potentially bug-inducing clashes between compiler- and linker-
generated __bss_end symbols.
Make __bss_end and __bss_start compiler-only, and create
__bss_base and __bss_limit for linker-only use.
Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
Reported-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
This commit is contained in:
parent
4411b2aea7
commit
f84a7b8f54
arch/arm/cpu
board
|
@ -69,17 +69,23 @@ SECTIONS
|
||||||
|
|
||||||
_end = .;
|
_end = .;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
|
||||||
|
* __bss_base and __bss_limit are for linker only (overlay ordering)
|
||||||
|
*/
|
||||||
|
|
||||||
.bss_start __rel_dyn_start (OVERLAY) : {
|
.bss_start __rel_dyn_start (OVERLAY) : {
|
||||||
KEEP(*(.__bss_start));
|
KEEP(*(.__bss_start));
|
||||||
|
__bss_base = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bss __bss_start (OVERLAY) : {
|
.bss __bss_base (OVERLAY) : {
|
||||||
*(.bss*)
|
*(.bss*)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__bss_end = .;
|
__bss_limit = .;
|
||||||
}
|
}
|
||||||
.bss_end __bss_end (OVERLAY) : {
|
.bss_end __bss_limit (OVERLAY) : {
|
||||||
KEEP(*(__bss_end));
|
KEEP(*(.__bss_end));
|
||||||
}
|
}
|
||||||
|
|
||||||
/DISCARD/ : { *(.dynstr*) }
|
/DISCARD/ : { *(.dynstr*) }
|
||||||
|
|
|
@ -81,18 +81,24 @@ SECTIONS
|
||||||
*(.mmutable)
|
*(.mmutable)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
|
||||||
|
* __bss_base and __bss_limit are for linker only (overlay ordering)
|
||||||
|
*/
|
||||||
|
|
||||||
.bss_start __rel_dyn_start (OVERLAY) : {
|
.bss_start __rel_dyn_start (OVERLAY) : {
|
||||||
KEEP(*(.__bss_start));
|
KEEP(*(.__bss_start));
|
||||||
|
__bss_base = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bss __bss_start (OVERLAY) : {
|
.bss __bss_base (OVERLAY) : {
|
||||||
*(.bss*)
|
*(.bss*)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__bss_end = .;
|
__bss_limit = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bss_end __bss_end (OVERLAY) : {
|
.bss_end __bss_limit (OVERLAY) : {
|
||||||
KEEP(*(__bss_end));
|
KEEP(*(.__bss_end));
|
||||||
}
|
}
|
||||||
|
|
||||||
/DISCARD/ : { *(.dynstr*) }
|
/DISCARD/ : { *(.dynstr*) }
|
||||||
|
|
|
@ -77,17 +77,23 @@ SECTIONS
|
||||||
|
|
||||||
_end = .;
|
_end = .;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
|
||||||
|
* __bss_base and __bss_limit are for linker only (overlay ordering)
|
||||||
|
*/
|
||||||
|
|
||||||
.bss_start __rel_dyn_start (OVERLAY) : {
|
.bss_start __rel_dyn_start (OVERLAY) : {
|
||||||
KEEP(*(.__bss_start));
|
KEEP(*(.__bss_start));
|
||||||
|
__bss_base = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bss __bss_start (OVERLAY) : {
|
.bss __bss_base (OVERLAY) : {
|
||||||
*(.bss*)
|
*(.bss*)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__bss_end = .;
|
__bss_limit = .;
|
||||||
}
|
}
|
||||||
.bss_end __bss_end (OVERLAY) : {
|
.bss_end __bss_limit (OVERLAY) : {
|
||||||
KEEP(*(__bss_end));
|
KEEP(*(.__bss_end));
|
||||||
}
|
}
|
||||||
|
|
||||||
/DISCARD/ : { *(.dynstr*) }
|
/DISCARD/ : { *(.dynstr*) }
|
||||||
|
|
|
@ -77,17 +77,23 @@ SECTIONS
|
||||||
|
|
||||||
_end = .;
|
_end = .;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
|
||||||
|
* __bss_base and __bss_limit are for linker only (overlay ordering)
|
||||||
|
*/
|
||||||
|
|
||||||
.bss_start __rel_dyn_start (OVERLAY) : {
|
.bss_start __rel_dyn_start (OVERLAY) : {
|
||||||
KEEP(*(.__bss_start));
|
KEEP(*(.__bss_start));
|
||||||
|
__bss_base = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bss __bss_start (OVERLAY) : {
|
.bss __bss_base (OVERLAY) : {
|
||||||
*(.bss*)
|
*(.bss*)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__bss_end = .;
|
__bss_limit = .;
|
||||||
}
|
}
|
||||||
.bss_end __bss_end (OVERLAY) : {
|
.bss_end __bss_limit (OVERLAY) : {
|
||||||
KEEP(*(__bss_end));
|
KEEP(*(.__bss_end));
|
||||||
}
|
}
|
||||||
|
|
||||||
/DISCARD/ : { *(.dynstr*) }
|
/DISCARD/ : { *(.dynstr*) }
|
||||||
|
|
|
@ -77,17 +77,23 @@ SECTIONS
|
||||||
|
|
||||||
_end = .;
|
_end = .;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
|
||||||
|
* __bss_base and __bss_limit are for linker only (overlay ordering)
|
||||||
|
*/
|
||||||
|
|
||||||
.bss_start __rel_dyn_start (OVERLAY) : {
|
.bss_start __rel_dyn_start (OVERLAY) : {
|
||||||
KEEP(*(.__bss_start));
|
KEEP(*(.__bss_start));
|
||||||
|
__bss_base = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bss __bss_start (OVERLAY) : {
|
.bss __bss_base (OVERLAY) : {
|
||||||
*(.bss*)
|
*(.bss*)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__bss_end = .;
|
__bss_limit = .;
|
||||||
}
|
}
|
||||||
.bss_end __bss_end (OVERLAY) : {
|
.bss_end __bss_limit (OVERLAY) : {
|
||||||
KEEP(*(__bss_end));
|
KEEP(*(.__bss_end));
|
||||||
}
|
}
|
||||||
|
|
||||||
/DISCARD/ : { *(.dynstr*) }
|
/DISCARD/ : { *(.dynstr*) }
|
||||||
|
|
|
@ -77,17 +77,23 @@ SECTIONS
|
||||||
|
|
||||||
_end = .;
|
_end = .;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
|
||||||
|
* __bss_base and __bss_limit are for linker only (overlay ordering)
|
||||||
|
*/
|
||||||
|
|
||||||
.bss_start __rel_dyn_start (OVERLAY) : {
|
.bss_start __rel_dyn_start (OVERLAY) : {
|
||||||
KEEP(*(.__bss_start));
|
KEEP(*(.__bss_start));
|
||||||
|
__bss_base = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bss __bss_start (OVERLAY) : {
|
.bss __bss_base (OVERLAY) : {
|
||||||
*(.bss*)
|
*(.bss*)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__bss_end = .;
|
__bss_limit = .;
|
||||||
}
|
}
|
||||||
.bss_end __bss_end (OVERLAY) : {
|
.bss_end __bss_limit (OVERLAY) : {
|
||||||
KEEP(*(__bss_end));
|
KEEP(*(.__bss_end));
|
||||||
}
|
}
|
||||||
|
|
||||||
/DISCARD/ : { *(.dynstr*) }
|
/DISCARD/ : { *(.dynstr*) }
|
||||||
|
|
|
@ -80,17 +80,23 @@ SECTIONS
|
||||||
|
|
||||||
_end = .;
|
_end = .;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Compiler-generated __bss_start and __bss_end, see arch/arm/lib/bss.c
|
||||||
|
* __bss_base and __bss_limit are for linker only (overlay ordering)
|
||||||
|
*/
|
||||||
|
|
||||||
.bss_start __rel_dyn_start (OVERLAY) : {
|
.bss_start __rel_dyn_start (OVERLAY) : {
|
||||||
KEEP(*(.__bss_start));
|
KEEP(*(.__bss_start));
|
||||||
|
__bss_base = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bss __bss_start (OVERLAY) : {
|
.bss __bss_base (OVERLAY) : {
|
||||||
*(.bss*)
|
*(.bss*)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
__bss_end = .;
|
__bss_limit = .;
|
||||||
}
|
}
|
||||||
.bss_end __bss_end (OVERLAY) : {
|
.bss_end __bss_limit (OVERLAY) : {
|
||||||
KEEP(*(__bss_end));
|
KEEP(*(.__bss_end));
|
||||||
}
|
}
|
||||||
|
|
||||||
/DISCARD/ : { *(.bss*) }
|
/DISCARD/ : { *(.bss*) }
|
||||||
|
|
Loading…
Reference in New Issue