Towards developing my own bootloader I've stumbled over an issue with
avr-gcc. I am trying to compile my code with the compiler flags
-flto #to enable link time optimization -nostartfiles #to omit the interrupt vector table
My bootloader consists of multiple files which are used depending of compile flags. All the sources are being compiled and linked while the code path only leads to some portions of them. So I wanted to get rid of the dead code and
-flto (being a newer development) creates a much smaller machine code size than
-ffunction-sections -fdata-sections with
But when it comes to further reducing the machine code size by removing the interrupt vector table using
-nostartfiles, the complete code gets optimized away leaving me with a zero byte output.
Has anyone experienced the same issue with that compiler flag combination?