Skip to content

Commit 66eeea4

Browse files
author
TAiGA
committed
Move C++ constructor and destructor tables and .bss to .irom0 (flash)
1 parent fe451a8 commit 66eeea4

File tree

2 files changed

+49
-17
lines changed

2 files changed

+49
-17
lines changed

tools/sdk/ld/eagle.app.v6.common.ld.h

Lines changed: 48 additions & 0 deletions
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

@@ -229,6 +247,36 @@ SECTIONS
229247
/* Fundamental type info */
230248
*(.rodata._ZTIPKc .rodata._ZTIc .rodata._ZTIv .rodata._ZTSv .rodata._ZTSc .rodata._ZTSPKc .rodata._ZTSi .rodata._ZTIi)
231249

250+
/* std::make_shared */
251+
*(.rodata._ZZNSt19_Sp_make_shared_tag5_S_tiEvE5__tag)
252+
253+
#ifdef FREE_MORE_DRAM
254+
*(.sdk.version)
255+
*libc.a:lib_a-dtoa.o (.rodata .rodata.*)
256+
*libc.a:lib_a-gdtoa-gethex.o (.rodata .rodata.*)
257+
*libc.a:lib_a-impure.o (.rodata .rodata.*)
258+
*libc.a:lib_a-lcltime.o (.rodata .rodata.*)
259+
*libc.a:lib_a-lnumeric.o (.rodata .rodata.*)
260+
*libc.a:lib_a-locale.o (.rodata .rodata.* .data)
261+
*libc.a:lib_a-mprec.o (.rodata .rodata.*)
262+
*libc.a:lib_a-nano-svfprintf.o (.rodata .rodata.*)
263+
*libc.a:lib_a-nano-svfscanf.o (.rodata .rodata.*)
264+
*libc.a:lib_a-nano-vfprintf_float.o (.rodata .rodata.*)
265+
*libc.a:lib_a-nano-vfprintf.o (.rodata .rodata.*)
266+
*libc.a:lib_a-nano-vfscanf_float.o (.rodata .rodata.*)
267+
*libc.a:lib_a-nano-vfscanf_i.o (.rodata .rodata.*)
268+
*libc.a:lib_a-rand.o (.rodata .rodata.*)
269+
*libc.a:lib_a-strtod.o (.rodata .rodata.*)
270+
*libc.a:lib_a-tzset_r.o (.rodata .rodata.*)
271+
*libc.a:lib_a-tzvars.o (.rodata .rodata.*)
272+
*liblwip2-536.a: (.rodata .rodata.memp_pools .rodata.tcp_pcb_lists .rodata.dns_mquery_v4group .rodata.ip_addr_broadcast .rodata.ip_addr_any)
273+
*liblwip2-1460.a: (.rodata .rodata.memp_pools .rodata.tcp_pcb_lists .rodata.dns_mquery_v4group .rodata.ip_addr_broadcast .rodata.ip_addr_any)
274+
*libnet80211.a:ieee80211_input.o (.rodata .rodata.* .data)
275+
*libnet80211.a:ieee80211_scan.o (.rodata .rodata.* .data)
276+
*libphy.a:phy_chip_v6.o (.rodata .rodata.*)
277+
*libpp.a:esf_buf.o (.rodata .rodata.*)
278+
#endif
279+
232280
. = ALIGN(4);
233281
*(.gcc_except_table .gcc_except_table.*)
234282
. = ALIGN(4);

tools/sdk/ld/eagle.app.v6.common.ld.vtables.h

Lines changed: 1 addition & 17 deletions
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)