From bd8aed54ca4c5b88b23922ccdd958be8bd3d165b Mon Sep 17 00:00:00 2001 From: Jerzy Kasenberg Date: Thu, 23 Nov 2023 13:03:45 +0100 Subject: [PATCH] compiler: Strip .image_header section in bin This sepcifies .image_header section that will be removed from elf when .bin file is generated. So far there is no such section used. With this change it is possible to have elf file that already contains image header (in .image_header section). This header will be removed and so create image will add new one. Elf file containing image header can be flashed by debugger, this way output build from cmake can be use directly by IDE that supports cmake. --- newt/toolchain/compiler.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go index 9354206d0..c63eabbf6 100644 --- a/newt/toolchain/compiler.go +++ b/newt/toolchain/compiler.go @@ -1108,6 +1108,8 @@ func (c *Compiler) generateExtras(elfFilename string, ".bss.core", "-R", ".bss.core.nz", + "-R", + ".image_header", "-O", "binary", elfFilename,