From 4c878eeb0a35dd6dc72e4c18f3ffa760a1f75689 Mon Sep 17 00:00:00 2001 From: Armando Date: Fri, 3 Feb 2023 18:28:23 +0800 Subject: [PATCH] sections_ld: add description to .flash.rodata_noload This commit also move _rodata_reserved_end symbol right at the entry of the .flash.rodata_noload. --- components/esp_system/ld/esp32/sections.ld.in | 10 +++++++++- components/esp_system/ld/esp32c2/sections.ld.in | 10 +++++++++- components/esp_system/ld/esp32c3/sections.ld.in | 10 +++++++++- components/esp_system/ld/esp32c6/sections.ld.in | 10 +++++++++- components/esp_system/ld/esp32h4/sections.ld.in | 11 +++++++++-- components/esp_system/ld/esp32s2/sections.ld.in | 10 +++++++++- components/esp_system/ld/esp32s3/sections.ld.in | 10 +++++++++- 7 files changed, 63 insertions(+), 8 deletions(-) diff --git a/components/esp_system/ld/esp32/sections.ld.in b/components/esp_system/ld/esp32/sections.ld.in index 6ed8405458..fc64206ad9 100644 --- a/components/esp_system/ld/esp32/sections.ld.in +++ b/components/esp_system/ld/esp32/sections.ld.in @@ -324,11 +324,19 @@ SECTIONS _flash_rodata_align = ALIGNOF(.flash.rodata); + /* + This section is a place where we dump all the rodata which aren't used at runtime, + so as to avoid binary size increase + */ .flash.rodata_noload (NOLOAD) : { + /* + This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address + We don't need to include the noload rodata in this section + */ + _rodata_reserved_end = ABSOLUTE(.); . = ALIGN (4); mapping[rodata_noload] - _rodata_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address */ } > default_rodata_seg .flash.text : diff --git a/components/esp_system/ld/esp32c2/sections.ld.in b/components/esp_system/ld/esp32c2/sections.ld.in index b7d7af6361..a6a9290062 100644 --- a/components/esp_system/ld/esp32c2/sections.ld.in +++ b/components/esp_system/ld/esp32c2/sections.ld.in @@ -245,11 +245,19 @@ SECTIONS __eh_frame_hdr_end = ABSOLUTE(.); } > default_rodata_seg + /* + This section is a place where we dump all the rodata which aren't used at runtime, + so as to avoid binary size increase + */ .flash.rodata_noload (NOLOAD) : { + /* + This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address + We don't need to include the noload rodata in this section + */ + _rodata_reserved_end = ABSOLUTE(.); . = ALIGN (4); mapping[rodata_noload] - _rodata_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address */ } > default_rodata_seg /* Marks the end of IRAM code segment */ diff --git a/components/esp_system/ld/esp32c3/sections.ld.in b/components/esp_system/ld/esp32c3/sections.ld.in index 7f5063059b..13cbf84025 100644 --- a/components/esp_system/ld/esp32c3/sections.ld.in +++ b/components/esp_system/ld/esp32c3/sections.ld.in @@ -355,11 +355,19 @@ SECTIONS __eh_frame_hdr_end = ABSOLUTE(.); } > default_rodata_seg + /* + This section is a place where we dump all the rodata which aren't used at runtime, + so as to avoid binary size increase + */ .flash.rodata_noload (NOLOAD) : { + /* + This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address + We don't need to include the noload rodata in this section + */ + _rodata_reserved_end = ABSOLUTE(.); . = ALIGN (4); mapping[rodata_noload] - _rodata_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address */ } > default_rodata_seg /* Marks the end of IRAM code segment */ diff --git a/components/esp_system/ld/esp32c6/sections.ld.in b/components/esp_system/ld/esp32c6/sections.ld.in index e370398d57..34c9bd38d3 100644 --- a/components/esp_system/ld/esp32c6/sections.ld.in +++ b/components/esp_system/ld/esp32c6/sections.ld.in @@ -388,11 +388,19 @@ SECTIONS __eh_frame_hdr_end = ABSOLUTE(.); } > default_rodata_seg + /* + This section is a place where we dump all the rodata which aren't used at runtime, + so as to avoid binary size increase + */ .flash.rodata_noload (NOLOAD) : { + /* + This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address + We don't need to include the noload rodata in this section + */ + _rodata_reserved_end = ABSOLUTE(.); . = ALIGN (4); mapping[rodata_noload] - _rodata_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address */ } > default_rodata_seg /* Marks the end of data, bss and possibly rodata */ diff --git a/components/esp_system/ld/esp32h4/sections.ld.in b/components/esp_system/ld/esp32h4/sections.ld.in index 484a989de3..43fbf0cb1f 100644 --- a/components/esp_system/ld/esp32h4/sections.ld.in +++ b/components/esp_system/ld/esp32h4/sections.ld.in @@ -358,11 +358,18 @@ SECTIONS __eh_frame_hdr_end = ABSOLUTE(.); } > default_rodata_seg + /* + This section is a place where we dump all the rodata which aren't used at runtime, + so as to avoid binary size increase + */ .flash.rodata_noload (NOLOAD) : { + /* + This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address + We don't need to include the noload rodata in this section + */ + _rodata_reserved_end = ABSOLUTE(.); . = ALIGN (4); - /* Empty for now, only a container for `_rodata_reserved_end` symbol, add needed rodata noload mappings here if needed */ - _rodata_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address */ } > default_rodata_seg /* Marks the end of IRAM code segment */ diff --git a/components/esp_system/ld/esp32s2/sections.ld.in b/components/esp_system/ld/esp32s2/sections.ld.in index ac4ea14f96..b8e461df42 100644 --- a/components/esp_system/ld/esp32s2/sections.ld.in +++ b/components/esp_system/ld/esp32s2/sections.ld.in @@ -340,11 +340,19 @@ SECTIONS _flash_rodata_align = ALIGNOF(.flash.rodata); + /* + This section is a place where we dump all the rodata which aren't used at runtime, + so as to avoid binary size increase + */ .flash.rodata_noload (NOLOAD) : { + /* + This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address + We don't need to include the noload rodata in this section + */ + _rodata_reserved_end = ABSOLUTE(.); . = ALIGN (4); mapping[rodata_noload] - _rodata_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address */ } > default_rodata_seg .flash.text : diff --git a/components/esp_system/ld/esp32s3/sections.ld.in b/components/esp_system/ld/esp32s3/sections.ld.in index 2689fe7e83..d14f1da402 100644 --- a/components/esp_system/ld/esp32s3/sections.ld.in +++ b/components/esp_system/ld/esp32s3/sections.ld.in @@ -366,11 +366,19 @@ SECTIONS _flash_rodata_align = ALIGNOF(.flash.rodata); + /* + This section is a place where we dump all the rodata which aren't used at runtime, + so as to avoid binary size increase + */ .flash.rodata_noload (NOLOAD) : { + /* + This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address + We don't need to include the noload rodata in this section + */ + _rodata_reserved_end = ABSOLUTE(.); . = ALIGN (4); mapping[rodata_noload] - _rodata_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.rodata end, this can be used for mmu driver to maintain virtual address */ } > default_rodata_seg /**