Skip to content
This repository was archived by the owner on Jan 24, 2022. It is now read-only.

Commit 2b08758

Browse files
committed
pad .bss and .data so their sizes are always multiple of 4 bytes
1 parent f9ba9dc commit 2b08758

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1313
will go into Flash memory will be 4 byte aligned at the start and at the
1414
end. Which seems to be required (?) by Cortex-M0 devices.
1515

16+
- .bss and .data are now padded so their sizes are multiple of 4 bytes. This
17+
improves the output of `objdump`; before, the output showed "Address
18+
0x20000004 is out of bounds".
19+
1620
## [v0.3.3] - 2017-07-14
1721

1822
### Changed

link.x

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PROVIDE(_stack_start = ORIGIN(RAM) + LENGTH(RAM));
99

1010
SECTIONS
1111
{
12-
.vector_table ORIGIN(FLASH) :
12+
.vector_table ORIGIN(FLASH) : ALIGN(4)
1313
{
1414
/* Vector table */
1515
_svector_table = .;
@@ -45,18 +45,19 @@ SECTIONS
4545
{
4646
_sbss = .;
4747
*(.bss .bss.*);
48-
_ebss = ALIGN(4);
48+
. = ALIGN(4);
49+
_ebss = .;
4950
} > RAM
5051

5152
.data : ALIGN(4)
5253
{
54+
_sidata = LOADADDR(.data);
5355
_sdata = .;
5456
*(.data .data.*);
55-
_edata = ALIGN(4);
57+
. = ALIGN(4);
58+
_edata = .;
5659
} > RAM AT > FLASH
5760

58-
_sidata = LOADADDR(.data);
59-
6061
/* The heap starts right after the .bss + .data section ends */
6162
_sheap = _edata;
6263

0 commit comments

Comments
 (0)