2.10.1. Avoiding the ARM‑supplied heap and heap‑using functions
If you are developing embedded systems that have limited RAM or that provide their own heap management (for example, an operating system), you might require a system that does not define a heap area. To avoid using the heap you can either:
You can reference the __use_no_heap or __use_no_heap_region symbols in your code in order to guarantee that no heap‑using functions are linked in from the ARM library. Only import these symbols once in your application, for example, using either:
If you include a heap‑using function and also reference __use_no_heap, the library detects the clashing symbols and the linker reports an error.
To find out which objects are using the heap, link with ‑‑verbose ‑‑list=out.txt, search the output for the relevant symbol (in this case malloc), and find out what object referenced it.