Minor linker script touchups. (#3717)

* refactor(esp-hal/ld): inline `rodata_desc.x`

* refactor(esp-hal/ld): consolidate `.trap` section definition
This commit is contained in:
Gabriel Hansson 2025-06-30 15:19:02 +02:00 committed by GitHub
parent cc199a26f3
commit a8af564313
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 16 additions and 50 deletions

View File

@ -16,7 +16,6 @@ INCLUDE "fixups/rtc_fast_rwdata_dummy.x"
/* Shared sections - ordering matters */
SECTIONS {
INCLUDE "rodata_desc.x"
INCLUDE "rwtext.x"
INCLUDE "rwdata.x"
}

View File

@ -1,14 +1,5 @@
/* esp32c2 fixups */
SECTIONS {
.trap : ALIGN(4)
{
KEEP(*(.trap));
*(.trap.*);
} > RWTEXT
}
INSERT BEFORE .rwtext;
SECTIONS {
.rotext_dummy (NOLOAD) :
{
@ -52,7 +43,6 @@ INSERT BEFORE .data;
/* Shared sections - ordering matters */
SECTIONS {
INCLUDE "rodata_desc.x"
INCLUDE "rwtext.x"
INCLUDE "rwdata.x"
}

View File

@ -1,14 +1,5 @@
/* esp32c3 fixups */
SECTIONS {
.trap : ALIGN(4)
{
KEEP(*(.trap));
*(.trap.*);
} > RWTEXT
}
INSERT BEFORE .rwtext;
SECTIONS {
.rotext_dummy (NOLOAD) :
{
@ -52,7 +43,6 @@ INSERT BEFORE .data;
/* Shared sections - ordering matters */
SECTIONS {
INCLUDE "rodata_desc.x"
INCLUDE "rwtext.x"
INCLUDE "rwdata.x"
}

View File

@ -5,12 +5,6 @@
PROVIDE(interrupt0 = DefaultHandler);
SECTIONS {
.trap : ALIGN(4)
{
KEEP(*(.trap));
*(.trap.*);
} > RWTEXT
/* Shared sections - ordering matters */
INCLUDE "rwtext.x"
INCLUDE "rwdata.x"
@ -36,10 +30,6 @@ INSERT BEFORE .text;
/* end of esp32c6 fixups */
/* Shared sections #2 - ordering matters */
SECTIONS {
INCLUDE "rodata_desc.x"
}
INCLUDE "rodata.x"
INCLUDE "text.x"
INCLUDE "rtc_fast.x"

View File

@ -4,12 +4,6 @@
PROVIDE(interrupt0 = DefaultHandler);
SECTIONS {
.trap : ALIGN(4)
{
KEEP(*(.trap));
*(.trap.*);
} > RWTEXT
/* Shared sections - ordering matters */
INCLUDE "rwtext.x"
INCLUDE "rwdata.x"
@ -34,9 +28,6 @@ SECTIONS {
INSERT BEFORE .text;
/* Shared sections #2 - ordering matters */
SECTIONS {
INCLUDE "rodata_desc.x"
}
INCLUDE "rodata.x"
INCLUDE "text.x"
INCLUDE "rtc_fast.x"

View File

@ -24,7 +24,6 @@ INCLUDE "fixups/rtc_fast_rwdata_dummy.x"
/* Shared sections - ordering matters */
SECTIONS {
INCLUDE "rodata_desc.x"
INCLUDE "rwtext.x"
INCLUDE "rwdata.x"
}

View File

@ -50,7 +50,6 @@ INSERT BEFORE .data;
/* Shared sections - ordering matters */
SECTIONS {
INCLUDE "rodata_desc.x"
INCLUDE "rwtext.x"
INCLUDE "rwdata.x"
}

View File

@ -1,6 +1,11 @@
SECTIONS {
/* For ESP App Description, must be placed first in image */
.rodata_desc : ALIGN(4)
{
KEEP(*(.rodata_desc));
KEEP(*(.rodata_desc.*));
} > RODATA
.rodata : ALIGN(4)
{
. = ALIGN (4);
@ -17,4 +22,4 @@ SECTIONS {
*( .rodata_wlog_*.* )
. = ALIGN(4);
} > RODATA
}
}

View File

@ -1,5 +0,0 @@
.rodata_desc : ALIGN(4)
{
KEEP(*(.rodata_desc));
KEEP(*(.rodata_desc.*));
} > RODATA

View File

@ -1,3 +1,11 @@
#IF riscv
.trap : ALIGN(4)
{
KEEP(*(.trap));
*(.trap.*);
} > RWTEXT
#ENDIF
.rwtext : ALIGN(4)
{
. = ALIGN (4);