cortex-M cpp destructor problem
Hi,
We use this compiler Version 4.6u4 and we have found an interesting problem.
First we use cpp classes in our application. Some are created with NEW and some are global. From what I see, the newlib default __libc_init_array create all the global classes (call constructor) automaticaly.
BUT also create a destructor table in case of problem (__atexit). On embedded platform like cortex-M, we never exit the code. This will use RAM (dynamicaly allocated) but will never used.
We have also found a probem in the function __register_exitproc from __atexit.c of newlib 1.20.0. I have no Idea from where this function is called, but from what I can see, the arg 'args = p->_on_
For now we have created an empty __cxa_atexit function in our code to not create the destructor table.
I would like to know if there is something special to pass on compiler line to not use the destructor table , and not using exit function at all.
Regards
Jonathan
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Joey Ye
- Solved:
- Last query:
- Last reply: