I am currently working on a Bootloader in Atmel Studio for Atmega328P (Arduino UNO), and from the disassembly I found the following code (My bootloader starts from 0x3800):
--- ../../../../crt1/gcrt1.S ---------------------------------------------------
00003800 JMP 0x00003834 Jump
00003802 JMP 0x00003979 Jump
00003804 JMP 0x00003979 Jump
00003806 JMP 0x00003979 Jump
00003808 JMP 0x00003979 Jump
0000380A JMP 0x00003979 Jump
0000380C JMP 0x00003979 Jump
0000380E JMP 0x00003979 Jump
--- ../../../../crt1/gcrt1.S ---------------------------------------------------
00003810 JMP 0x00003979 Jump
00003812 JMP 0x00003979 Jump
00003814 JMP 0x00003979 Jump
00003816 JMP 0x00003979 Jump
00003818 JMP 0x00003979 Jump
0000381A JMP 0x00003979 Jump
0000381C JMP 0x00003979 Jump
0000381E JMP 0x00003979 Jump
00003820 JMP 0x00003979 Jump
00003822 JMP 0x00003979 Jump
00003824 JMP 0x00003979 Jump
00003826 JMP 0x00003979 Jump
00003828 JMP 0x00003979 Jump
0000382A JMP 0x00003979 Jump
0000382C JMP 0x00003979 Jump
0000382E JMP 0x00003979 Jump
00003830 JMP 0x00003979 Jump
00003832 JMP 0x00003979 Jump
--- C:\Users\andy\Documents\Atmel Studio\7.0\CannyFlashy\CannyFlashy\CannyFlashy\Debug/.././Sketch.cpp
int main(){
00003834 IN R28,0x3D In from I/O location
Why is GCC generating such code and is there anyway to avoid them?