This is an automated email from the ASF dual-hosted git repository.

sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git

commit be5be3fa5cc1094a7e0b22b80a8dd6acab343414
Author: Szymon Janc <[email protected]>
AuthorDate: Wed Oct 21 09:34:48 2026 +0200

    newt/builder: Fail split image build on conflicting global symbols
    
    IdenticalUnion() returns an error when the loader and the split
    application share a global data symbol with different sizes or from
    different packages. The error, which asks the user to reconcile the
    conflict, was assigned but never checked, so the build continued and
    could produce a loader and app that use two distinct copies of the
    same variable.
    
    Return the error instead of ignoring it.
    
    Assisted-by: Claude:claude-opus-5-5
---
 newt/builder/targetbuild.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/newt/builder/targetbuild.go b/newt/builder/targetbuild.go
index b68ddbeb..6a79e037 100644
--- a/newt/builder/targetbuild.go
+++ b/newt/builder/targetbuild.go
@@ -694,6 +694,9 @@ func (t *TargetBuilder) RelinkLoader() (error, 
map[string]bool,
        /* create the set of matching and non-matching symbols */
        err, smMatch, smNomatch := symbol.IdenticalUnion(appLibSym,
                loaderLibSym, true, false)
+       if err != nil {
+               return err, nil, nil
+       }
 
        /* which packages are shared between the two */
        commonPkgs := smMatch.Packages()

Reply via email to