Re-add deleted linker options to the Bootloader makefiles, which was preventing the...
[pub/USBasp.git] / Bootloaders / DFU / makefile
index e53fca6..2cfff0f 100644 (file)
@@ -85,9 +85,11 @@ F_CPU = 8000000
 F_CLOCK = $(F_CPU)
 
 
 F_CLOCK = $(F_CPU)
 
 
-# Starting byte address of the bootloader, as a byte address. Note that the address given
-# in the AVRStudio fuse programming dialogue uses word addresses, which will have to be
-# doubled to obtain the starting byte address of the bootloader section.
+# Starting byte address of the bootloader, as a byte address - computed via the formula
+#   BOOT_START = ((TOTAL_FLASH_BYTES - BOOTLOADER_SECTION_SIZE_BYTES) * 1024)
+#
+# Note that the bootloader size and start address given in AVRStudio is in words and not
+# bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC.
 BOOT_START = 0x1E000
 
 
 BOOT_START = 0x1E000
 
 
@@ -323,6 +325,7 @@ EXTMEMOPTS =
 #    -Map:      create map file
 #    --cref:    add cross reference to  map file
 LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
 #    -Map:      create map file
 #    --cref:    add cross reference to  map file
 LDFLAGS  = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS += -Wl,--section-start=.text=$(BOOT_START)
 LDFLAGS += -Wl,--relax 
 LDFLAGS += -Wl,--gc-sections
 LDFLAGS += $(EXTMEMOPTS)
 LDFLAGS += -Wl,--relax 
 LDFLAGS += -Wl,--gc-sections
 LDFLAGS += $(EXTMEMOPTS)