Repository navigation
Conversation
Contributor
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
Comment on lines
+3364
to
+3366
| ifeq ($(WOLFBOOT_VERSION_SECTION),) | ||
| CFLAGS+=-DWOLFBOOT_VERSION_SECTION=$(WOLFBOOT_VERSION_SECTION) | ||
| endif |
| #endif | ||
| static volatile const uint32_t __attribute__((used)) wolfboot_version = WOLFBOOT_VERSION; | ||
|
|
||
| static volatile const uint32_t __attribute__((used)) WOLFBOOT_VERSION_SECTION wolfboot_version = WOLFBOOT_VERSION; |
vhdirk
force-pushed
the
named-version-section
branch
from
November 2, 2026 15:13
060ec96 to
e608555
Compare
Member
|
Okay to test. Company contributor agreement on file. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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