Skip to content

Commit

Permalink
Fix rodata reservation. (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch committed Dec 6, 2024
1 parent 102006e commit 4ec8df6
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 6 deletions.
7 changes: 6 additions & 1 deletion components/esp_system/ld/esp32c2/sections.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,13 @@ SECTIONS
* driver to maintain the virtual address.
* NOLOAD rodata may not be included in this section.
*/
/**
* Toit: add padding.
* Not completely sure this is the correct way of doing this, but we need to
* reserve space for the Toit containers.
*/
. += _esp_rodata_section_padding;
_rodata_reserved_end = ADDR(.flash.tbss);
_rodata_reserved_end = ADDR(.flash.tbss) + _esp_rodata_section_padding;

mapping[rodata_noload]
} > default_rodata_seg
Expand Down
7 changes: 6 additions & 1 deletion components/esp_system/ld/esp32c3/sections.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,13 @@ SECTIONS
* driver to maintain the virtual address.
* NOLOAD rodata may not be included in this section.
*/
/**
* Toit: add padding.
* Not completely sure this is the correct way of doing this, but we need to
* reserve space for the Toit containers.
*/
. += _esp_rodata_section_padding;
_rodata_reserved_end = ADDR(.flash.tbss);
_rodata_reserved_end = ADDR(.flash.tbss) + _esp_rodata_section_padding;

mapping[rodata_noload]
} > default_rodata_seg
Expand Down
7 changes: 6 additions & 1 deletion components/esp_system/ld/esp32c6/sections.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,13 @@ SECTIONS
* driver to maintain the virtual address.
* NOLOAD rodata may not be included in this section.
*/
/**
* Toit: add padding.
* Not completely sure this is the correct way of doing this, but we need to
* reserve space for the Toit containers.
*/
. += _esp_rodata_section_padding;
_rodata_reserved_end = ADDR(.flash.tbss);
_rodata_reserved_end = ADDR(.flash.tbss) + _esp_rodata_section_padding;

mapping[rodata_noload]
} > default_rodata_seg
Expand Down
8 changes: 7 additions & 1 deletion components/esp_system/ld/esp32c61/sections.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,13 @@ SECTIONS
* driver to maintain the virtual address.
* NOLOAD rodata may not be included in this section.
*/
_rodata_reserved_end = ADDR(.flash.tbss);
/**
* Toit: add padding.
* Not completely sure this is the correct way of doing this, but we need to
* reserve space for the Toit containers.
*/
. += _esp_rodata_section_padding;
_rodata_reserved_end = ADDR(.flash.tbss) + _esp_rodata_section_padding;

mapping[rodata_noload]
} > default_rodata_seg
Expand Down
7 changes: 6 additions & 1 deletion components/esp_system/ld/esp32h2/sections.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,13 @@ SECTIONS
* driver to maintain the virtual address.
* NOLOAD rodata may not be included in this section.
*/
/**
* Toit: add padding.
* Not completely sure this is the correct way of doing this, but we need to
* reserve space for the Toit containers.
*/
. += _esp_rodata_section_padding;
_rodata_reserved_end = ADDR(.flash.tbss);
_rodata_reserved_end = ADDR(.flash.tbss) + _esp_rodata_section_padding;

mapping[rodata_noload]
} > default_rodata_seg
Expand Down
8 changes: 7 additions & 1 deletion components/esp_system/ld/esp32p4/sections.ld.in
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,13 @@ SECTIONS
* driver to maintain the virtual address.
* NOLOAD rodata may not be included in this section.
*/
_rodata_reserved_end = ADDR(.flash.tbss);
/**
* Toit: add padding.
* Not completely sure this is the correct way of doing this, but we need to
* reserve space for the Toit containers.
*/
. += _esp_rodata_section_padding;
_rodata_reserved_end = ADDR(.flash.tbss) + _esp_rodata_section_padding;

arrays[rodata_noload]
mapping[rodata_noload]
Expand Down

0 comments on commit 4ec8df6

Please sign in to comment.