Browse Source

renewed linker skripts for latest avr-binutils

Signed-off-by: Christian Kroll <chris@das-labor.org>
feature/2017
Christian Kroll 8 years ago
parent
commit
a880b0246c
  1. 39
      ld_scripts/avr5.x
  2. 39
      ld_scripts/avr51.x
  3. 39
      ld_scripts/avr6.x

39
ld_scripts/avr5.x

@ -1,4 +1,8 @@
/* Default linker script, for normal executables */ /* Default linker script, for normal executables */
/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
Copying and distribution of this script, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. */
OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr") OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
OUTPUT_ARCH(avr:5) OUTPUT_ARCH(avr:5)
MEMORY MEMORY
@ -9,6 +13,7 @@ MEMORY
fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
user_signatures (rw!x) : ORIGIN = 0x850000, LENGTH = 1K
} }
SECTIONS SECTIONS
{ {
@ -76,13 +81,19 @@ SECTIONS
KEEP(*(.vectors)) KEEP(*(.vectors))
/* For data that needs to reside in the lower 64k of progmem. */ /* For data that needs to reside in the lower 64k of progmem. */
*(.progmem.gcc*) *(.progmem.gcc*)
*(.progmem*) /* PR 13812: Placing the trampolines here gives a better chance
that they will be in range of the code that uses them. */
. = ALIGN(2); . = ALIGN(2);
__trampolines_start = . ; __trampolines_start = . ;
/* The jump trampolines for the 16-bit limited relocs will reside here. */ /* The jump trampolines for the 16-bit limited relocs will reside here. */
*(.trampolines) *(.trampolines)
*(.trampolines*) *(.trampolines*)
__trampolines_end = . ; __trampolines_end = . ;
/* avr-libc expects these data to reside in lower 64K. */
*libprintf_flt.a:*(.progmem.data)
*libc.a:*(.progmem.data)
*(.progmem*)
. = ALIGN(2);
/* For future tablejump instruction arrays for 3 byte pc devices. /* For future tablejump instruction arrays for 3 byte pc devices.
We don't relax jump/call instructions within these sections. */ We don't relax jump/call instructions within these sections. */
*(.jumptables) *(.jumptables)
@ -146,7 +157,7 @@ SECTIONS
KEEP (*(.fini0)) KEEP (*(.fini0))
_etext = . ; _etext = . ;
} > text } > text
.data : AT (ADDR (.text) + SIZEOF (.text)) .data :
{ {
PROVIDE (__data_start = .) ; PROVIDE (__data_start = .) ;
*(.data) *(.data)
@ -160,8 +171,8 @@ SECTIONS
. = ALIGN(2); . = ALIGN(2);
_edata = . ; _edata = . ;
PROVIDE (__data_end = .) ; PROVIDE (__data_end = .) ;
} > data } > data AT> text
.bss SIZEOF(.data) + ADDR(.data) : .bss ADDR(.data) + SIZEOF (.data) : AT (ADDR (.bss))
{ {
PROVIDE (__bss_start = .) ; PROVIDE (__bss_start = .) ;
*(.bss) *(.bss)
@ -172,7 +183,7 @@ SECTIONS
__data_load_start = LOADADDR(.data); __data_load_start = LOADADDR(.data);
__data_load_end = __data_load_start + SIZEOF(.data); __data_load_end = __data_load_start + SIZEOF(.data);
/* Global data not cleared after reset. */ /* Global data not cleared after reset. */
.noinit SIZEOF(.bss) + ADDR(.bss) : .noinit ADDR(.bss) + SIZEOF (.bss) : AT (ADDR (.noinit))
{ {
PROVIDE (__noinit_start = .) ; PROVIDE (__noinit_start = .) ;
*(.noinit*) *(.noinit*)
@ -182,7 +193,8 @@ SECTIONS
} > data } > data
.eeprom : .eeprom :
{ {
*(.eeprom*) /* See .data above... */
KEEP(*(.eeprom*))
__eeprom_end = . ; __eeprom_end = . ;
} > eeprom } > eeprom
.fuse : .fuse :
@ -208,6 +220,7 @@ SECTIONS
.stab.index 0 : { *(.stab.index) } .stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) } .stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) } .comment 0 : { *(.comment) }
.note.gnu.build-id : { *(.note.gnu.build-id) }
/* DWARF debug sections. /* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */ of the section so we begin them at 0. */
@ -221,11 +234,21 @@ SECTIONS
.debug_aranges 0 : { *(.debug_aranges) } .debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) } .debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */ /* DWARF 2 */
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) } .debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) } .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) } .debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) } .debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) } .debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) } .debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* DWARF 3 */
.debug_pubtypes 0 : { *(.debug_pubtypes) }
.debug_ranges 0 : { *(.debug_ranges) }
/* DWARF Extension. */
.debug_macro 0 : { *(.debug_macro) }
} }

39
ld_scripts/avr51.x

@ -1,4 +1,8 @@
/* Default linker script, for normal executables */ /* Default linker script, for normal executables */
/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
Copying and distribution of this script, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. */
OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr") OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
OUTPUT_ARCH(avr:51) OUTPUT_ARCH(avr:51)
MEMORY MEMORY
@ -9,6 +13,7 @@ MEMORY
fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
user_signatures (rw!x) : ORIGIN = 0x850000, LENGTH = 1K
} }
SECTIONS SECTIONS
{ {
@ -76,13 +81,19 @@ SECTIONS
KEEP(*(.vectors)) KEEP(*(.vectors))
/* For data that needs to reside in the lower 64k of progmem. */ /* For data that needs to reside in the lower 64k of progmem. */
*(.progmem.gcc*) *(.progmem.gcc*)
*(.progmem*) /* PR 13812: Placing the trampolines here gives a better chance
that they will be in range of the code that uses them. */
. = ALIGN(2); . = ALIGN(2);
__trampolines_start = . ; __trampolines_start = . ;
/* The jump trampolines for the 16-bit limited relocs will reside here. */ /* The jump trampolines for the 16-bit limited relocs will reside here. */
*(.trampolines) *(.trampolines)
*(.trampolines*) *(.trampolines*)
__trampolines_end = . ; __trampolines_end = . ;
/* avr-libc expects these data to reside in lower 64K. */
*libprintf_flt.a:*(.progmem.data)
*libc.a:*(.progmem.data)
*(.progmem*)
. = ALIGN(2);
/* For future tablejump instruction arrays for 3 byte pc devices. /* For future tablejump instruction arrays for 3 byte pc devices.
We don't relax jump/call instructions within these sections. */ We don't relax jump/call instructions within these sections. */
*(.jumptables) *(.jumptables)
@ -146,7 +157,7 @@ SECTIONS
KEEP (*(.fini0)) KEEP (*(.fini0))
_etext = . ; _etext = . ;
} > text } > text
.data : AT (ADDR (.text) + SIZEOF (.text)) .data :
{ {
PROVIDE (__data_start = .) ; PROVIDE (__data_start = .) ;
*(.data) *(.data)
@ -160,8 +171,8 @@ SECTIONS
. = ALIGN(2); . = ALIGN(2);
_edata = . ; _edata = . ;
PROVIDE (__data_end = .) ; PROVIDE (__data_end = .) ;
} > data } > data AT> text
.bss SIZEOF(.data) + ADDR(.data) : .bss ADDR(.data) + SIZEOF (.data) : AT (ADDR (.bss))
{ {
PROVIDE (__bss_start = .) ; PROVIDE (__bss_start = .) ;
*(.bss) *(.bss)
@ -172,7 +183,7 @@ SECTIONS
__data_load_start = LOADADDR(.data); __data_load_start = LOADADDR(.data);
__data_load_end = __data_load_start + SIZEOF(.data); __data_load_end = __data_load_start + SIZEOF(.data);
/* Global data not cleared after reset. */ /* Global data not cleared after reset. */
.noinit SIZEOF(.bss) + ADDR(.bss) : .noinit ADDR(.bss) + SIZEOF (.bss) : AT (ADDR (.noinit))
{ {
PROVIDE (__noinit_start = .) ; PROVIDE (__noinit_start = .) ;
*(.noinit*) *(.noinit*)
@ -182,7 +193,8 @@ SECTIONS
} > data } > data
.eeprom : .eeprom :
{ {
*(.eeprom*) /* See .data above... */
KEEP(*(.eeprom*))
__eeprom_end = . ; __eeprom_end = . ;
} > eeprom } > eeprom
.fuse : .fuse :
@ -208,6 +220,7 @@ SECTIONS
.stab.index 0 : { *(.stab.index) } .stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) } .stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) } .comment 0 : { *(.comment) }
.note.gnu.build-id : { *(.note.gnu.build-id) }
/* DWARF debug sections. /* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */ of the section so we begin them at 0. */
@ -221,11 +234,21 @@ SECTIONS
.debug_aranges 0 : { *(.debug_aranges) } .debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) } .debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */ /* DWARF 2 */
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) } .debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) } .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) } .debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) } .debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) } .debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) } .debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* DWARF 3 */
.debug_pubtypes 0 : { *(.debug_pubtypes) }
.debug_ranges 0 : { *(.debug_ranges) }
/* DWARF Extension. */
.debug_macro 0 : { *(.debug_macro) }
} }

39
ld_scripts/avr6.x

@ -1,4 +1,8 @@
/* Default linker script, for normal executables */ /* Default linker script, for normal executables */
/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
Copying and distribution of this script, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. */
OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr") OUTPUT_FORMAT("elf32-avr","elf32-avr","elf32-avr")
OUTPUT_ARCH(avr:6) OUTPUT_ARCH(avr:6)
MEMORY MEMORY
@ -9,6 +13,7 @@ MEMORY
fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
user_signatures (rw!x) : ORIGIN = 0x850000, LENGTH = 1K
} }
SECTIONS SECTIONS
{ {
@ -76,13 +81,19 @@ SECTIONS
KEEP(*(.vectors)) KEEP(*(.vectors))
/* For data that needs to reside in the lower 64k of progmem. */ /* For data that needs to reside in the lower 64k of progmem. */
*(.progmem.gcc*) *(.progmem.gcc*)
*(.progmem*) /* PR 13812: Placing the trampolines here gives a better chance
that they will be in range of the code that uses them. */
. = ALIGN(2); . = ALIGN(2);
__trampolines_start = . ; __trampolines_start = . ;
/* The jump trampolines for the 16-bit limited relocs will reside here. */ /* The jump trampolines for the 16-bit limited relocs will reside here. */
*(.trampolines) *(.trampolines)
*(.trampolines*) *(.trampolines*)
__trampolines_end = . ; __trampolines_end = . ;
/* avr-libc expects these data to reside in lower 64K. */
*libprintf_flt.a:*(.progmem.data)
*libc.a:*(.progmem.data)
*(.progmem*)
. = ALIGN(2);
/* For future tablejump instruction arrays for 3 byte pc devices. /* For future tablejump instruction arrays for 3 byte pc devices.
We don't relax jump/call instructions within these sections. */ We don't relax jump/call instructions within these sections. */
*(.jumptables) *(.jumptables)
@ -146,7 +157,7 @@ SECTIONS
KEEP (*(.fini0)) KEEP (*(.fini0))
_etext = . ; _etext = . ;
} > text } > text
.data : AT (ADDR (.text) + SIZEOF (.text)) .data :
{ {
PROVIDE (__data_start = .) ; PROVIDE (__data_start = .) ;
*(.data) *(.data)
@ -160,8 +171,8 @@ SECTIONS
. = ALIGN(2); . = ALIGN(2);
_edata = . ; _edata = . ;
PROVIDE (__data_end = .) ; PROVIDE (__data_end = .) ;
} > data } > data AT> text
.bss SIZEOF(.data) + ADDR(.data) : .bss ADDR(.data) + SIZEOF (.data) : AT (ADDR (.bss))
{ {
PROVIDE (__bss_start = .) ; PROVIDE (__bss_start = .) ;
*(.bss) *(.bss)
@ -172,7 +183,7 @@ SECTIONS
__data_load_start = LOADADDR(.data); __data_load_start = LOADADDR(.data);
__data_load_end = __data_load_start + SIZEOF(.data); __data_load_end = __data_load_start + SIZEOF(.data);
/* Global data not cleared after reset. */ /* Global data not cleared after reset. */
.noinit SIZEOF(.bss) + ADDR(.bss) : .noinit ADDR(.bss) + SIZEOF (.bss) : AT (ADDR (.noinit))
{ {
PROVIDE (__noinit_start = .) ; PROVIDE (__noinit_start = .) ;
*(.noinit*) *(.noinit*)
@ -182,7 +193,8 @@ SECTIONS
} > data } > data
.eeprom : .eeprom :
{ {
*(.eeprom*) /* See .data above... */
KEEP(*(.eeprom*))
__eeprom_end = . ; __eeprom_end = . ;
} > eeprom } > eeprom
.fuse : .fuse :
@ -208,6 +220,7 @@ SECTIONS
.stab.index 0 : { *(.stab.index) } .stab.index 0 : { *(.stab.index) }
.stab.indexstr 0 : { *(.stab.indexstr) } .stab.indexstr 0 : { *(.stab.indexstr) }
.comment 0 : { *(.comment) } .comment 0 : { *(.comment) }
.note.gnu.build-id : { *(.note.gnu.build-id) }
/* DWARF debug sections. /* DWARF debug sections.
Symbols in the DWARF debugging sections are relative to the beginning Symbols in the DWARF debugging sections are relative to the beginning
of the section so we begin them at 0. */ of the section so we begin them at 0. */
@ -221,11 +234,21 @@ SECTIONS
.debug_aranges 0 : { *(.debug_aranges) } .debug_aranges 0 : { *(.debug_aranges) }
.debug_pubnames 0 : { *(.debug_pubnames) } .debug_pubnames 0 : { *(.debug_pubnames) }
/* DWARF 2 */ /* DWARF 2 */
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
.debug_abbrev 0 : { *(.debug_abbrev) } .debug_abbrev 0 : { *(.debug_abbrev) }
.debug_line 0 : { *(.debug_line) } .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end ) }
.debug_frame 0 : { *(.debug_frame) } .debug_frame 0 : { *(.debug_frame) }
.debug_str 0 : { *(.debug_str) } .debug_str 0 : { *(.debug_str) }
.debug_loc 0 : { *(.debug_loc) } .debug_loc 0 : { *(.debug_loc) }
.debug_macinfo 0 : { *(.debug_macinfo) } .debug_macinfo 0 : { *(.debug_macinfo) }
/* SGI/MIPS DWARF 2 extensions */
.debug_weaknames 0 : { *(.debug_weaknames) }
.debug_funcnames 0 : { *(.debug_funcnames) }
.debug_typenames 0 : { *(.debug_typenames) }
.debug_varnames 0 : { *(.debug_varnames) }
/* DWARF 3 */
.debug_pubtypes 0 : { *(.debug_pubtypes) }
.debug_ranges 0 : { *(.debug_ranges) }
/* DWARF Extension. */
.debug_macro 0 : { *(.debug_macro) }
} }

Loading…
Cancel
Save