Skip to content

Commit e674f2a

Browse files
committed
ldscripts/cpp: add -CC option to preserve comments
1 parent 1210abc commit e674f2a

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

Diff for: tools/sdk/ld/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ all:
99
@echo " heap: move c++ vtables to heap"
1010

1111
heap:
12-
@(echo "$(WARN)"; $(CPP) -E -DVTABLES_IN_DRAM $(COMMON).h | grep -v '^#') > $(COMMON)
12+
@(echo "$(WARN)"; $(CPP) -CC -E -DVTABLES_IN_DRAM $(COMMON).h | grep -v '^#') > $(COMMON)
1313
@echo "c++ vtables moved to heap"
1414

1515
iram:
16-
@(echo "$(WARN)"; $(CPP) -E -DVTABLES_IN_IRAM $(COMMON).h | grep -v '^#') > $(COMMON)
16+
@(echo "$(WARN)"; $(CPP) -CC -E -DVTABLES_IN_IRAM $(COMMON).h | grep -v '^#') > $(COMMON)
1717
@echo "c++ vtables moved to iram"

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

+11-10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* warning: AUTOGENERATED from eagle.app.v6.common.ld*.h */
2-
3-
2+
/* This linker script generated from xt-genldscripts.tpp for LSP . */
3+
/* Linker Script for ld -N */
44

55
PHDRS
66
{
@@ -12,7 +12,7 @@ PHDRS
1212
}
1313

1414

15-
15+
/* Default entry point: */
1616
ENTRY(call_user_start)
1717
EXTERN(_DebugExceptionVector)
1818
EXTERN(_DoubleExceptionVector)
@@ -21,7 +21,7 @@ EXTERN(_NMIExceptionVector)
2121
EXTERN(_UserExceptionVector)
2222
EXTERN(core_version)
2323
PROVIDE(_memmap_vecbase_reset = 0x40000000);
24-
24+
/* Various memory-map dependent cache attribute settings: */
2525
_memmap_cacheattr_wb_base = 0x00000110;
2626
_memmap_cacheattr_wt_base = 0x00000110;
2727
_memmap_cacheattr_bp_base = 0x00000220;
@@ -159,7 +159,7 @@ SECTIONS
159159
*.cpp.o(.iram.text)
160160
*.c.o(.iram.text)
161161

162-
*(.rodata._ZTV*)
162+
*(.rodata._ZTV*) /* C++ vtables */
163163

164164
*(.fini.literal)
165165
*(.fini)
@@ -184,7 +184,7 @@ SECTIONS
184184
*(.gnu.version_r)
185185
*(.eh_frame)
186186
. = (. + 3) & ~ 3;
187-
187+
/* C++ constructor and destructor tables, properly ordered: */
188188
__init_array_start = ABSOLUTE(.);
189189
KEEP (*crtbegin.o(.ctors))
190190
KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
@@ -195,15 +195,15 @@ SECTIONS
195195
KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
196196
KEEP (*(SORT(.dtors.*)))
197197
KEEP (*(.dtors))
198-
198+
/* C++ exception handlers table: */
199199
__XT_EXCEPTION_DESCS__ = ABSOLUTE(.);
200200
*(.xt_except_desc)
201201
*(.gnu.linkonce.h.*)
202202
__XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
203203
*(.xt_except_desc_end)
204204
*(.dynamic)
205205
*(.gnu.version_d)
206-
. = ALIGN(4);
206+
. = ALIGN(4); /* this table MUST be 4-byte aligned */
207207
_bss_table_start = ABSOLUTE(.);
208208
LONG(_bss_start)
209209
LONG(_bss_end)
@@ -231,8 +231,9 @@ SECTIONS
231231
. = ALIGN (8);
232232
_bss_end = ABSOLUTE(.);
233233
_heap_start = ABSOLUTE(.);
234-
234+
/* _stack_sentry = ALIGN(0x8); */
235235
} >dram0_0_seg :dram0_0_bss_phdr
236+
/* __stack = 0x3ffc8000; */
236237

237238

238239
.lit4 : ALIGN(4)
@@ -247,5 +248,5 @@ SECTIONS
247248

248249
}
249250

250-
251+
/* get ROM code address */
251252
INCLUDE "../ld/eagle.rom.addr.v6.ld"

0 commit comments

Comments
 (0)