Using arm-none-eabi-gcc for Cortex-M4 (baremetal application), the code for malloc is also emitted even though I never use malloc in my code.
malloc
S
Probably you need -fno-use-cxa-atexit argument for compiler.
-fno-use-cxa-atexit
Look on this simple example to get working C++ code on pure bare-metal: https://github.com/cortexm/baremetal