GCC - How to stop malloc being linked?

前端 未结 2 660
星月不相逢
星月不相逢 2021-01-16 10:09

I am struggling to get my code down to minimal bare bones size! I am using a STM32F0 with only 32k flash and need a good part of the flash for data storage. My code is alr

2条回答
  •  情歌与酒
    2021-01-16 10:40

    When you are wondering about what takes space, or why functions and libraries have been linked in, generate a map file with cross references - something like "-Wl,-Map=program.map,--cref". Look at the file with a text editor, and you can see why a function like malloc has been included.

提交回复
热议问题