Skip to content

Commit 66ecc33

Browse files
authored
Move C++ constructor and destructor tables from .bss to .irom0 (flash) (#8737)
1 parent f06710e commit 66ecc33

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

Diff for: tools/sdk/ld/eagle.app.v6.common.ld.h

+18
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,24 @@ SECTIONS
162162
*(.rodata._ZTV*) /* C++ vtables */
163163
#endif
164164

165+
. = ALIGN(4); /* this table MUST be 4-byte aligned */
166+
/* C++ constructor and destructor tables, properly ordered: */
167+
__init_array_start = ABSOLUTE(.);
168+
KEEP (*crtbegin.o(.ctors))
169+
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
170+
KEEP (*(SORT(.ctors.*)))
171+
KEEP (*(.ctors))
172+
__init_array_end = ABSOLUTE(.);
173+
KEEP (*crtbegin.o(.dtors))
174+
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
175+
KEEP (*(SORT(.dtors.*)))
176+
KEEP (*(.dtors))
177+
. = ALIGN(4); /* this table MUST be 4-byte aligned */
178+
_bss_table_start = ABSOLUTE(.);
179+
LONG(_bss_start)
180+
LONG(_bss_end)
181+
_bss_table_end = ABSOLUTE(.);
182+
165183
*libgcc.a:unwind-dw2.o(.literal .text .rodata .literal.* .text.* .rodata.*)
166184
*libgcc.a:unwind-dw2-fde.o(.literal .text .rodata .literal.* .text.* .rodata.*)
167185

Diff for: tools/sdk/ld/eagle.app.v6.common.ld.vtables.h

+1-17
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,7 @@
1212
*(.gnu.linkonce.e.*)
1313
*(.gnu.version_r)
1414
*(.eh_frame)
15-
. = (. + 3) & ~ 3;
16-
/* C++ constructor and destructor tables, properly ordered: */
17-
__init_array_start = ABSOLUTE(.);
18-
KEEP (*crtbegin.o(.ctors))
19-
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
20-
KEEP (*(SORT(.ctors.*)))
21-
KEEP (*(.ctors))
22-
__init_array_end = ABSOLUTE(.);
23-
KEEP (*crtbegin.o(.dtors))
24-
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
25-
KEEP (*(SORT(.dtors.*)))
26-
KEEP (*(.dtors))
15+
. = ALIGN(4);
2716
/* C++ exception handlers table: */
2817
__XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
2918
*(.xt_except_desc)
@@ -32,11 +21,6 @@
3221
*(.xt_except_desc_end)
3322
*(.dynamic)
3423
*(.gnu.version_d)
35-
. = ALIGN(4); /* this table MUST be 4-byte aligned */
36-
_bss_table_start = ABSOLUTE(.);
37-
LONG(_bss_start)
38-
LONG(_bss_end)
39-
_bss_table_end = ABSOLUTE(.);
4024
_rodata_end = ABSOLUTE(.);
4125
} >dram0_0_seg :dram0_0_phdr
4226

0 commit comments

Comments
 (0)