forked from zephyrproject-rtos/zephyr
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linker: correct linker script _flash_used calculation
Linker scripts contains a `.last_section` section that is placed in rom region as NOLOAD for the purpose of retrieve the actual number of bytes contained in the image. See d85efe0 However, a previous section may cause the location counter to be incremented for alignment purposes. This can result in the size of the image to be 0x10FA but location counter to be 0x1100 because it has been aligned for next section placement. Therefore, two new Kconfig settings are introduced. Those settings request the linker to will write a pattern in `.last_section`. Together with removing NOLOAD and writing a patten to the section then we ensure that data is written after alignment of location counter, and thereby forces the image size to be in sync with the location counter. The default pattern used will be 0xE015 (end of last section). Some systems may fill up the flash completely, or simply write data at the end of the flash, which in both cases can result in overflow. Therefore, the new settings can be disabled. Signed-off-by: Torsten Rasmussen <[email protected]>
- Loading branch information
1 parent
11e3344
commit c107827
Showing
6 changed files
with
61 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters