提交 cded27b5 编写于 作者: B Bernard Xiong

Update crt_init.c

上级 0e18dfed
...@@ -51,14 +51,14 @@ int cplusplus_system_init(void) ...@@ -51,14 +51,14 @@ int cplusplus_system_init(void)
(*ctors_func)(); (*ctors_func)();
} }
#elif defined(__CC_ARM) #elif defined(__CC_ARM)
# if 1
/* If there is no SHT$$INIT_ARRAY, calling /* If there is no SHT$$INIT_ARRAY, calling
* $Super$$__cpp_initialize__aeabi_() will fault. At least until Keil5.12 * $Super$$__cpp_initialize__aeabi_() will cause fault. At least until Keil5.12
* the problem still exists. So we have to initialize the C++ runtime our * the problem still exists. So we have to initialize the C++ runtime by ourself.
* own. */ */
typedef void PROC(); typedef void PROC();
extern const unsigned long SHT$$INIT_ARRAY$$Base[]; extern const unsigned long SHT$$INIT_ARRAY$$Base[];
extern const unsigned long SHT$$INIT_ARRAY$$Limit[]; extern const unsigned long SHT$$INIT_ARRAY$$Limit[];
const unsigned long *base = SHT$$INIT_ARRAY$$Base; const unsigned long *base = SHT$$INIT_ARRAY$$Base;
const unsigned long *lim = SHT$$INIT_ARRAY$$Limit; const unsigned long *lim = SHT$$INIT_ARRAY$$Limit;
...@@ -67,10 +67,6 @@ int cplusplus_system_init(void) ...@@ -67,10 +67,6 @@ int cplusplus_system_init(void)
PROC *proc = (PROC*)((const char*)base + *base); PROC *proc = (PROC*)((const char*)base + *base);
(*proc)(); (*proc)();
} }
# else
/* call armcc lib to initialize cplusplus */
$Super$$__cpp_initialize__aeabi_();
# endif
#endif #endif
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册