Skip to content

Commit

Permalink
[rom,chip_info] Mark kChipInfo as used so it is not discarded
Browse files Browse the repository at this point in the history
With LTO, the linker is more eager to remove it since it's not used
anywhere.

Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Feb 3, 2025
1 parent 1dc284f commit 347819e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions util/rom_chip_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def generate_chip_info_c_source(scm_revision: int) -> str:
#include "sw/device/lib/base/macros.h"
OT_USED
OT_SECTION(".chip_info")
const chip_info_t kChipInfo = {{
.scm_revision = (chip_info_scm_revision_t){{
Expand Down
2 changes: 2 additions & 0 deletions util/rom_chip_info_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def test_simple(self):
#include "sw/device/lib/base/macros.h"
OT_USED
OT_SECTION(".chip_info")
const chip_info_t kChipInfo = {
.scm_revision = (chip_info_scm_revision_t){
Expand All @@ -52,6 +53,7 @@ def test_sha1_digest_leading_zero_byte(self):
#include "sw/device/lib/base/macros.h"
OT_USED
OT_SECTION(".chip_info")
const chip_info_t kChipInfo = {
.scm_revision = (chip_info_scm_revision_t){
Expand Down

0 comments on commit 347819e

Please sign in to comment.