Skip to content

Commit

Permalink
Move C++ constructor and destructor tables from .bss to .irom0 (flash) (
Browse files Browse the repository at this point in the history
  • Loading branch information
metarutaiga authored Jan 5, 2023
1 parent f06710e commit 66ecc33
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 17 deletions.
18 changes: 18 additions & 0 deletions tools/sdk/ld/eagle.app.v6.common.ld.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,24 @@ SECTIONS
*(.rodata._ZTV*) /* C++ vtables */
#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-fde.o(.literal .text .rodata .literal.* .text.* .rodata.*)

Expand Down
18 changes: 1 addition & 17 deletions tools/sdk/ld/eagle.app.v6.common.ld.vtables.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,7 @@
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
*(.eh_frame)
. = (. + 3) & ~ 3;
/* 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);
/* C++ exception handlers table: */
__XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
*(.xt_except_desc)
Expand All @@ -32,11 +21,6 @@
*(.xt_except_desc_end)
*(.dynamic)
*(.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(.);
} >dram0_0_seg :dram0_0_phdr

Expand Down

0 comments on commit 66ecc33

Please sign in to comment.