summaryrefslogtreecommitdiffstats
path: root/patches/binutils-2.20.1a/atmel/0003-Add-new-memory-regions-to-the-AVR-linker-script-temp.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/binutils-2.20.1a/atmel/0003-Add-new-memory-regions-to-the-AVR-linker-script-temp.patch')
-rw-r--r--patches/binutils-2.20.1a/atmel/0003-Add-new-memory-regions-to-the-AVR-linker-script-temp.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/patches/binutils-2.20.1a/atmel/0003-Add-new-memory-regions-to-the-AVR-linker-script-temp.patch b/patches/binutils-2.20.1a/atmel/0003-Add-new-memory-regions-to-the-AVR-linker-script-temp.patch
new file mode 100644
index 0000000..dae2a00
--- /dev/null
+++ b/patches/binutils-2.20.1a/atmel/0003-Add-new-memory-regions-to-the-AVR-linker-script-temp.patch
@@ -0,0 +1,65 @@
+From 4d26906081a15ebbd0961196721665241c499f54 Mon Sep 17 00:00:00 2001
+From: Stephan Linz <linz@li-pro.net>
+Date: Mon, 18 Apr 2011 21:08:29 +0200
+Subject: [PATCH 3/9] Add new memory regions to the AVR linker script template
+
+This adds support for fuse, lock and signature memory regions.
+This patch has been used extensively in the field for a while
+with no issues and allows this data to be added to the ELF output
+file. The fuse and lock information is needed for programming the
+AVR chip. So this allows the user to contain all information needed
+for programming an AVR chip in one single ELF file.
+
+Quote by Eric Weddington (2011-03-14):
+http://old.nabble.com/-AVR--Add-new-memory-regions-to-script-template-td31144851.html
+
+Original ATMEL patch from:
+http://distribute.atmel.no/tools/opensource/avr-gcc/binutils-2.20.1/32-binutils-2.20.1-new-sections.patch
+
+Signed-off-by: Stephan Linz <linz@li-pro.net>
+---
+ ld/scripttempl/avr.sc | 21 +++++++++++++++++++++
+ 1 files changed, 21 insertions(+), 0 deletions(-)
+
+diff --git a/ld/scripttempl/avr.sc b/ld/scripttempl/avr.sc
+index 4545b72..c11de86 100644
+--- a/ld/scripttempl/avr.sc
++++ b/ld/scripttempl/avr.sc
+@@ -7,6 +7,9 @@ MEMORY
+ text (rx) : ORIGIN = 0, LENGTH = $TEXT_LENGTH
+ data (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = $DATA_LENGTH
+ eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
++ fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
++ lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
++ signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
+ }
+
+ SECTIONS
+@@ -196,6 +199,24 @@ SECTIONS
+ ${RELOCATING+ __eeprom_end = . ; }
+ } ${RELOCATING+ > eeprom}
+
++ .fuse ${RELOCATING-0}:
++ {
++ KEEP(*(.fuse))
++ KEEP(*(.lfuse))
++ KEEP(*(.hfuse))
++ KEEP(*(.efuse))
++ } ${RELOCATING+ > fuse}
++
++ .lock ${RELOCATING-0}:
++ {
++ KEEP(*(.lock*))
++ } ${RELOCATING+ > lock}
++
++ .signature ${RELOCATING-0}:
++ {
++ KEEP(*(.signature*))
++ } ${RELOCATING+ > signature}
++
+ /* Stabs debugging sections. */
+ .stab 0 : { *(.stab) }
+ .stabstr 0 : { *(.stabstr) }
+--
+1.6.0.4
+