Skip to content

Commit

Permalink
Add "bsp.wholeapplinkerscript" linker script setting to allow larger …
Browse files Browse the repository at this point in the history
…split images
  • Loading branch information
hasty committed Sep 8, 2021
1 parent 3a1d858 commit 7458a29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion newt/builder/targetbuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,13 @@ func (t *TargetBuilder) buildLoader() error {
/* Tentatively link the app (using the normal single image linker
* script)
*/
if err := t.AppBuilder.TentativeLink(t.bspPkg.LinkerScripts,
var appLinkerScripts []string
if len(t.bspPkg.WholeAppLinkerScripts) > 0 {
appLinkerScripts = t.bspPkg.WholeAppLinkerScripts
} else {
appLinkerScripts = t.bspPkg.LinkerScripts
}
if err := t.AppBuilder.TentativeLink(appLinkerScripts,
t.extraADirs()); err != nil {

return err
Expand Down
3 changes: 3 additions & 0 deletions newt/pkg/bsp_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type BspPackage struct {
CompilerName string
Arch string
LinkerScripts []string
WholeAppLinkerScripts []string /* scripts to tentatively link app for split image as though it had full use of both slots */
SplitAppLinkerScripts []string /* scripts to link app to second partition */
DownloadScript string
DebugScript string
Expand Down Expand Up @@ -145,6 +146,8 @@ func (bsp *BspPackage) Reload(settings map[string]string) error {
return err
}

bsp.WholeAppLinkerScripts, err = bsp.resolveLinkerScriptSetting(
settings, "bsp.wholeapplinkerscript")
if err != nil {
return err
}
Expand Down

0 comments on commit 7458a29

Please sign in to comment.