You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/07/12 02:57:09 UTC

[incubator-nuttx] 04/04: esp32c3-devkit: Change output section identifiers to satisfy GDB

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

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit cc0ea2689c6ffe844a1e3acd4e74a4580e28a892
Author: Gustavo Henrique Nihei <gu...@espressif.com>
AuthorDate: Mon Jul 11 15:22:28 2022 -0300

    esp32c3-devkit: Change output section identifiers to satisfy GDB
    
    Signed-off-by: Gustavo Henrique Nihei <gu...@espressif.com>
---
 .../esp32c3/esp32c3-devkit/scripts/user-space.ld   | 27 ++++++++++++++--------
 1 file changed, 17 insertions(+), 10 deletions(-)

diff --git a/boards/risc-v/esp32c3/esp32c3-devkit/scripts/user-space.ld b/boards/risc-v/esp32c3/esp32c3-devkit/scripts/user-space.ld
index 717c77efd9..f7bd85e576 100755
--- a/boards/risc-v/esp32c3/esp32c3-devkit/scripts/user-space.ld
+++ b/boards/risc-v/esp32c3/esp32c3-devkit/scripts/user-space.ld
@@ -30,7 +30,7 @@ SECTIONS
 
     LONG(ADDR(.userspace))
     LONG(LOADADDR(.userspace))
-    LONG(SIZEOF(.userspace) + SIZEOF(.flash.rodata))
+    LONG(SIZEOF(.userspace) + SIZEOF(.rodata))
 
     /* IROM metadata:
      * - Destination address (VMA) for IROM region
@@ -38,9 +38,9 @@ SECTIONS
      * - Size of IROM region
      */
 
-    LONG(ADDR(.flash.text))
-    LONG(LOADADDR(.flash.text))
-    LONG(SIZEOF(.flash.text))
+    LONG(ADDR(.text))
+    LONG(LOADADDR(.text))
+    LONG(SIZEOF(.text))
   } >metadata
 
   /* section info */
@@ -58,13 +58,20 @@ SECTIONS
   __ld_udram_size = LENGTH(UDRAM);
   __ld_udram_end = ORIGIN(UDRAM) + LENGTH(UDRAM);
 
-  _eronly = LOADADDR(.dram0.data);
+  _eronly = LOADADDR(.data);
 
   .userspace : {
     *(.userspace)
   } >UDROM AT>ROM
 
-  .flash.rodata :
+  /* Output sections for the Userspace image are given standard names, so
+   * instead of the Espressif-usual ".flash.text" we name it as ".text".
+   * The motivation is to ease debugging with GDB when loading symbols from
+   * both Kernel and User images since GDB's "add-symbol-file" command
+   * expects to find a .text section at the provided offset.
+   */
+
+  .rodata :
   {
     _srodata = ABSOLUTE(.);
 
@@ -142,7 +149,7 @@ SECTIONS
 
   /* Shared RAM */
 
-  .dram0.bss (NOLOAD) :
+  .bss (NOLOAD) :
   {
     . = ALIGN (8);
     _sbss = ABSOLUTE(.);
@@ -175,7 +182,7 @@ SECTIONS
     *(.noinit.*)
   } >UDRAM
 
-  .dram0.data :
+  .data :
   {
     _sdata = ABSOLUTE(.);
     *(.data)
@@ -197,10 +204,10 @@ SECTIONS
 
   .flash_text_dummy (NOLOAD) : ALIGN(0x00010000)
   {
-    . = SIZEOF(.userspace) + SIZEOF(.flash.rodata);
+    . = SIZEOF(.userspace) + SIZEOF(.rodata);
   } >UIROM
 
-  .flash.text : ALIGN(0x00010000)
+  .text : ALIGN(0x00010000)
   {
     _stext = .;