How to prevent inclusion of C library destructors and atexit()?

后端 未结 4 1624
梦谈多话
梦谈多话 2021-02-13 21:20

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.

S

4条回答
  •  無奈伤痛
    2021-02-13 21:58

    Probably you need -fno-use-cxa-atexit argument for compiler.

    Look on this simple example to get working C++ code on pure bare-metal: https://github.com/cortexm/baremetal

提交回复
热议问题