Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Critical issues prevent custom version-section settings from reaching the compiler correctly and leave the section attribute undefined in update_flash.c, breaking standalone RAM_CODE builds.
2 open issues
What changed in this PR
This PR introduces configurable linker-section placement for the wolfBoot version number, supporting version queries on bootloaders without a self header. It complements #958’s custom linker-script support.
Changes:
- Adds a configurable section attribute to the version declarations.
- Introduces shared stringification helpers.
- Adds build-flag handling for the section-name setting.
| File | Description |
|---|---|
| src/update_flash.c | Applies the section macro to the version declaration. |
| src/loader.c | Defines the section attribute and applies it to the version declaration. |
| include/wolfboot/wolfboot.h | Adds two-level stringification helpers. |
| arch.mk | Adds compiler-flag handling for the version-section option. |
Review effort: Balanced
060ec96 to
e608555
Compare
|
Okay to test. Company contributor agreement on file. |
There was a problem hiding this comment.
🟡 Changes recommended
WOLFBOOT_VERSION_SECTION is missing from CONFIG_VARS in tools/config.mk, so make config silently removes the setting and subsequent builds lose the named version section required by external readers.
1 open issue
2 resolved since last review
Review effort: Balanced
dgarske
left a comment
There was a problem hiding this comment.
One more copilot finding #966 (review)
1a17efa to
2a297c1
Compare
danielinux
left a comment
There was a problem hiding this comment.
IAR compatibility: please guard your gcc dialect attribute as follow:
#if defined(__IAR_SYSTEMS_ICC__)
#define WB_SECTION(name) __section(name)
#else
#define WB_SECTION(name) __attribute__((section(name)))
#endif
Also please rebase on latest master, resolve conflicts


We've been using wolfboot for quite some time. From what I can tell, way before
WOLFBOOT_SELF_HEADERwas introduced.To query the bootloader version, we keep the version in a named linker section.
At some point we would like to migrate to using the self header, but we'll always need to support older bootloaders that do not have a self header as well.
Together with #958, this commit enables us to provide the section name externally, limiting the number of patches we have to carry forward