1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-13 13:01:55 +03:00

Move C++ constructor and destructor tables from .bss to .irom0 (flash) (#8737)

This commit is contained in:
metarutaiga
2023-01-05 22:33:00 +08:00
committed by GitHub
parent f06710eb6e
commit 66ecc33916
2 changed files with 19 additions and 17 deletions

View File

@ -162,6 +162,24 @@ SECTIONS
*(.rodata._ZTV*) /* C++ vtables */ *(.rodata._ZTV*) /* C++ vtables */
#endif #endif
. = ALIGN(4); /* this table MUST be 4-byte aligned */
/* C++ constructor and destructor tables, properly ordered: */
__init_array_start = ABSOLUTE(.);
KEEP (*crtbegin.o(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
__init_array_end = ABSOLUTE(.);
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
. = ALIGN(4); /* this table MUST be 4-byte aligned */
_bss_table_start = ABSOLUTE(.);
LONG(_bss_start)
LONG(_bss_end)
_bss_table_end = ABSOLUTE(.);
*libgcc.a:unwind-dw2.o(.literal .text .rodata .literal.* .text.* .rodata.*) *libgcc.a:unwind-dw2.o(.literal .text .rodata .literal.* .text.* .rodata.*)
*libgcc.a:unwind-dw2-fde.o(.literal .text .rodata .literal.* .text.* .rodata.*) *libgcc.a:unwind-dw2-fde.o(.literal .text .rodata .literal.* .text.* .rodata.*)

View File

@ -12,18 +12,7 @@
*(.gnu.linkonce.e.*) *(.gnu.linkonce.e.*)
*(.gnu.version_r) *(.gnu.version_r)
*(.eh_frame) *(.eh_frame)
. = (. + 3) & ~ 3; . = ALIGN(4);
/* C++ constructor and destructor tables, properly ordered: */
__init_array_start = ABSOLUTE(.);
KEEP (*crtbegin.o(.ctors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
__init_array_end = ABSOLUTE(.);
KEEP (*crtbegin.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
/* C++ exception handlers table: */ /* C++ exception handlers table: */
__XT_EXCEPTION_DESCS__ = ABSOLUTE(.); __XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
*(.xt_except_desc) *(.xt_except_desc)
@ -32,11 +21,6 @@
*(.xt_except_desc_end) *(.xt_except_desc_end)
*(.dynamic) *(.dynamic)
*(.gnu.version_d) *(.gnu.version_d)
. = ALIGN(4); /* this table MUST be 4-byte aligned */
_bss_table_start = ABSOLUTE(.);
LONG(_bss_start)
LONG(_bss_end)
_bss_table_end = ABSOLUTE(.);
_rodata_end = ABSOLUTE(.); _rodata_end = ABSOLUTE(.);
} >dram0_0_seg :dram0_0_phdr } >dram0_0_seg :dram0_0_phdr