http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56533
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-05 12:38:51 UTC --- + /usr/bin/avr-gcc -mmcu=atmega328p -Os -flto -fwhole-program realmain.o main.a please provide the console output produced when adding -v to the above commandline. I suspect that you fall foul of using -fwhole-program without making the whole program visible to gcc via -flto by means of not using a compiler that can handle LTO of static archives. In general, don't use -fwhole-program with -flto, -flto is smart enough to discover things more intelligently.