diff options
| author | Bernard Xiong <[email protected]> | 2015-01-23 10:37:07 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2015-01-23 10:37:07 +0800 |
| commit | cded27b58ed6a196dd632744158c2ff89d067b6b (patch) | |
| tree | 53c26d6ee1b3991b2b13d803773c3d54f11b36ef | |
| parent | 0e18dfede729ea8b9940d4d3b4e947fdf9c08ced (diff) | |
Update crt_init.c
| -rw-r--r-- | components/cplusplus/crt_init.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/components/cplusplus/crt_init.c b/components/cplusplus/crt_init.c index e345052edd..958177c1f2 100644 --- a/components/cplusplus/crt_init.c +++ b/components/cplusplus/crt_init.c @@ -51,14 +51,14 @@ int cplusplus_system_init(void) (*ctors_func)(); } #elif defined(__CC_ARM) -# if 1 /* If there is no SHT$$INIT_ARRAY, calling - * $Super$$__cpp_initialize__aeabi_() will fault. At least until Keil5.12 - * the problem still exists. So we have to initialize the C++ runtime our - * own. */ + * $Super$$__cpp_initialize__aeabi_() will cause fault. At least until Keil5.12 + * the problem still exists. So we have to initialize the C++ runtime by ourself. + */ typedef void PROC(); extern const unsigned long SHT$$INIT_ARRAY$$Base[]; extern const unsigned long SHT$$INIT_ARRAY$$Limit[]; + const unsigned long *base = SHT$$INIT_ARRAY$$Base; const unsigned long *lim = SHT$$INIT_ARRAY$$Limit; @@ -67,10 +67,6 @@ int cplusplus_system_init(void) PROC *proc = (PROC*)((const char*)base + *base); (*proc)(); } -# else - /* call armcc lib to initialize cplusplus */ - $Super$$__cpp_initialize__aeabi_(); -# endif #endif return 0; |
