You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2024/09/10 07:14:30 UTC

(mynewt-core) 01/03: boot/startup: Add user_section.ld.h

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

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

commit bdf7b18d1a06ae2ac25650554209e5a63737e719
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Thu Aug 22 09:55:02 2024 +0200

    boot/startup: Add user_section.ld.h
    
    Some MCU/applications may require special sections
    in linker script
    
    So far memory_regions.ld.h could add non standard
    memory regions, newt link_tables could add filters
    to read only data for easy link time table generations.
    
    This adds way to add whole sections and or symbol
    definitions if required
    
    Signed-off-by: Jerzy Kasenberg <je...@codecoup.pl>
---
 boot/startup/mynewt_cortex_m0.ld               | 2 ++
 boot/startup/mynewt_cortex_m3.ld               | 2 ++
 boot/startup/mynewt_cortex_m33.ld              | 2 ++
 boot/startup/mynewt_cortex_m4.ld               | 2 ++
 boot/startup/mynewt_cortex_m7.ld               | 2 ++
 boot/startup/scripts/generate_linker_script.sh | 1 +
 6 files changed, 11 insertions(+)

diff --git a/boot/startup/mynewt_cortex_m0.ld b/boot/startup/mynewt_cortex_m0.ld
index 204f29f1f..ce4d8c0fa 100644
--- a/boot/startup/mynewt_cortex_m0.ld
+++ b/boot/startup/mynewt_cortex_m0.ld
@@ -43,6 +43,8 @@ MEMORY
 /* Define output sections */
 SECTIONS
 {
+#include <user_sections.ld.h>
+
     /*
      * Image header is added by newt tool during execution newt image-create.
      * This section allows to have complete elf with predefined image header that
diff --git a/boot/startup/mynewt_cortex_m3.ld b/boot/startup/mynewt_cortex_m3.ld
index 204f29f1f..ce4d8c0fa 100644
--- a/boot/startup/mynewt_cortex_m3.ld
+++ b/boot/startup/mynewt_cortex_m3.ld
@@ -43,6 +43,8 @@ MEMORY
 /* Define output sections */
 SECTIONS
 {
+#include <user_sections.ld.h>
+
     /*
      * Image header is added by newt tool during execution newt image-create.
      * This section allows to have complete elf with predefined image header that
diff --git a/boot/startup/mynewt_cortex_m33.ld b/boot/startup/mynewt_cortex_m33.ld
index 204f29f1f..ce4d8c0fa 100644
--- a/boot/startup/mynewt_cortex_m33.ld
+++ b/boot/startup/mynewt_cortex_m33.ld
@@ -43,6 +43,8 @@ MEMORY
 /* Define output sections */
 SECTIONS
 {
+#include <user_sections.ld.h>
+
     /*
      * Image header is added by newt tool during execution newt image-create.
      * This section allows to have complete elf with predefined image header that
diff --git a/boot/startup/mynewt_cortex_m4.ld b/boot/startup/mynewt_cortex_m4.ld
index 6f0237751..b74fd10de 100644
--- a/boot/startup/mynewt_cortex_m4.ld
+++ b/boot/startup/mynewt_cortex_m4.ld
@@ -55,6 +55,8 @@ MEMORY
 /* Define output sections */
 SECTIONS
 {
+#include <user_sections.ld.h>
+
     /*
      * Image header is added by newt tool during execution newt image-create.
      * This section allows to have complete elf with predefined image header that
diff --git a/boot/startup/mynewt_cortex_m7.ld b/boot/startup/mynewt_cortex_m7.ld
index 0d5031827..5bbe1f069 100644
--- a/boot/startup/mynewt_cortex_m7.ld
+++ b/boot/startup/mynewt_cortex_m7.ld
@@ -44,6 +44,8 @@ MEMORY
 /* Define output sections */
 SECTIONS
 {
+#include <user_sections.ld.h>
+
     /*
      * Image header is added by newt tool during execution newt image-create.
      * This section allows to have complete elf with predefined image header that
diff --git a/boot/startup/scripts/generate_linker_script.sh b/boot/startup/scripts/generate_linker_script.sh
index a9215ad06..4e528b5fe 100755
--- a/boot/startup/scripts/generate_linker_script.sh
+++ b/boot/startup/scripts/generate_linker_script.sh
@@ -25,6 +25,7 @@ touch ${MYNEWT_BUILD_GENERATED_DIR}/link/include/target_config.ld.h
 touch ${MYNEWT_BUILD_GENERATED_DIR}/link/include/memory_regions.ld.h
 touch ${MYNEWT_BUILD_GENERATED_DIR}/link/include/bsp_config.ld.h
 touch ${MYNEWT_BUILD_GENERATED_DIR}/link/include/mcu_config.ld.h
+touch ${MYNEWT_BUILD_GENERATED_DIR}/link/include/user_sections.ld.h
 
 set >env.txt
 ${MYNEWT_CC_PATH} -xc -DMYNEWT_SYSFLASH_ONLY_CONST -P -E \