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
-nostartfiles and -nostdlib worked for me in a similar context.
-nostartfiles
-nostdlib