Skip to content

Commit cded27b

Browse files
committed
Update crt_init.c
1 parent 0e18dfe commit cded27b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

components/cplusplus/crt_init.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ int cplusplus_system_init(void)
5151
(*ctors_func)();
5252
}
5353
#elif defined(__CC_ARM)
54-
# if 1
5554
/* If there is no SHT$$INIT_ARRAY, calling
56-
* $Super$$__cpp_initialize__aeabi_() will fault. At least until Keil5.12
57-
* the problem still exists. So we have to initialize the C++ runtime our
58-
* own. */
55+
* $Super$$__cpp_initialize__aeabi_() will cause fault. At least until Keil5.12
56+
* the problem still exists. So we have to initialize the C++ runtime by ourself.
57+
*/
5958
typedef void PROC();
6059
extern const unsigned long SHT$$INIT_ARRAY$$Base[];
6160
extern const unsigned long SHT$$INIT_ARRAY$$Limit[];
61+
6262
const unsigned long *base = SHT$$INIT_ARRAY$$Base;
6363
const unsigned long *lim = SHT$$INIT_ARRAY$$Limit;
6464

@@ -67,10 +67,6 @@ int cplusplus_system_init(void)
6767
PROC *proc = (PROC*)((const char*)base + *base);
6868
(*proc)();
6969
}
70-
# else
71-
/* call armcc lib to initialize cplusplus */
72-
$Super$$__cpp_initialize__aeabi_();
73-
# endif
7470
#endif
7571

7672
return 0;

0 commit comments

Comments
 (0)