--- avr6.x-new 2013-03-18 19:26:11.000000000 +1100 +++ avr6.x-test 2013-03-18 20:01:48.000000000 +1100 @@ -1,6 +1,7 @@ /* Default linker script, for normal executables */ OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr") OUTPUT_ARCH(avr:6) +__total_text = 256K ; MEMORY { text (rx) : ORIGIN = 0, LENGTH = 1024K @@ -124,6 +125,8 @@ SECTIONS .hightext : { + x = ASSERT (. <= __total_text, "Error: FlashN page placed beyond available flash memory.") ; + /* The following is OK to follow preceding sections at any even byte address, on any page. */ @@ -190,6 +193,9 @@ SECTIONS _edata = . ; PROVIDE (__data_end = .) ; } > data + + x = ASSERT (_etext + SIZEOF(.data) <= __total_text, "Error: text + data overflows available flash memory.") ; + .bss : AT (ADDR (.bss)) { PROVIDE (__bss_start = .) ;