STM32 gcc (arm-none-eabi-gcc) links printf even though it is not used
问题 I can't seem to figure out why some printf library functions get linked into my code from libc_nano.a even though I never use any printf . It steals at least 2K of valuable flash memory space. I can see the sections _printf_i , _vfprintf_r , _vfiprintf_r , etc. in my linker map file. I tried Wl,--exclude-libs option EXCLUDE_FILE(..) in linker script None of these make the symbols disappear from the map file.. My gcc options: CFLAGS = -Og -Wall -g3 -Wdouble-promotion -mcpu=cortex-m0 -mthumb