Skip to content

Commit

Permalink
sw/link: Avoid incorrect .bss delimiters
Browse files Browse the repository at this point in the history
Under some conditions, `__bss_start` and `__bss_end would not correctly delimit `.bss`.
  • Loading branch information
paulsc96 committed Nov 14, 2024
1 parent 816de68 commit 8dd9b79
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
8 changes: 3 additions & 5 deletions sw/link/dram.ld
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@ SECTIONS {
*(.sdata.*)
} > dram

. = ALIGN(32);
__bss_start = .;
.bss : {
.bss : ALIGN(16) {
__bss_start = .;
*(.bss)
*(.bss.*)
*(.sbss)
*(.sbss.*)
__bss_end = .;
} > dram
. = ALIGN(32);
__bss_end = .;

.bulk : ALIGN(16) {
*(.bulk)
Expand Down
8 changes: 3 additions & 5 deletions sw/link/rom.ld
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ SECTIONS {
} > spm AT>extrom

/* BSS is not loaded, but initialized by CRT0 */
. = ALIGN(32);
__bss_start = .;
.bss : {
.bss : ALIGN(16) {
__bss_start = .;
*(.bss)
*(.bss.*)
*(.sbss)
*(.sbss.*)
__bss_end = .;
} > spm
. = ALIGN(32);
__bss_end = .;
}
8 changes: 3 additions & 5 deletions sw/link/spm.ld
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ SECTIONS {
*(.sdata.*)
} > spm

. = ALIGN(32);
__bss_start = .;
.bss : {
.bss : ALIGN(16) {
__bss_start = .;
*(.bss)
*(.bss.*)
*(.sbss)
*(.sbss.*)
__bss_end = .;
} > spm
. = ALIGN(32);
__bss_end = .;

.bulk : ALIGN(16) {
*(.bulk)
Expand Down

0 comments on commit 8dd9b79

Please sign in to comment.