Well, it was in the documentation all onlg, but I just didn’t see it:
In the advanced help section for Adding C++ to an OpenAT project:
Toolchains used in order to build the Open AT application have some specificities, which are listed below.
RTE mode natively supports C++; there are no additional modifications or stubs to add to the application.
Target mode requires a stub to be added for memory management (since new and delete C++ operators depend on standard C memory management functions). This stub is provided here, and has to be added to every Open AT application project which aims to embed C++ code.
ARM ELF GCC
This toolchain has no specificities (except the need for the memory stub, explained just above). [/u][/b]
This toolchain requires some internal functions at the link stage as soon as C++ is used. These functions are provided in this stub, which has to be added to every Open AT application project compiled with the RVDS toolchain and which embeds C++ code.
C++ is not fully and correctly supported by this toolchain (no standard library, namespaces not supported). It is not recommended to use C++ with the ADS toolchain.
Referenced source code:
* Created on: Sep 13, 2010
* Author: cjohannsen
void *malloc(size_t n)
void free(void *p)
void *calloc(size_t n, size_t s)
void *p = malloc(n*s);
memset(p, 0, n*s);
Bada-bing, bada-boom: new() and delete() function properly.
And I can definitely assure you that if you do not include this source file, you will get module resets every time you try and use new() or delete().