2002-05-16 19:51:08 +00:00
|
|
|
cat <<EOF
|
|
|
|
OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
|
|
|
|
OUTPUT_ARCH(${ARCH})
|
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
text (rx) : ORIGIN = 0, LENGTH = $TEXT_LENGTH
|
2009-05-05 11:28:36 +00:00
|
|
|
data (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = $DATA_LENGTH
|
2002-05-16 19:51:08 +00:00
|
|
|
eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
|
2011-03-21 20:07:42 +00:00
|
|
|
fuse (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
|
|
|
|
lock (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
|
|
|
|
signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
|
2002-05-16 19:51:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
/* Read-only sections, merged into text segment: */
|
|
|
|
${TEXT_DYNAMIC+${DYNAMIC}}
|
2009-10-10 04:34:39 +00:00
|
|
|
.hash ${RELOCATING-0} : { *(.hash) }
|
|
|
|
.dynsym ${RELOCATING-0} : { *(.dynsym) }
|
|
|
|
.dynstr ${RELOCATING-0} : { *(.dynstr) }
|
|
|
|
.gnu.version ${RELOCATING-0} : { *(.gnu.version) }
|
|
|
|
.gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
|
|
|
|
.gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
|
|
|
|
|
|
|
|
.rel.init ${RELOCATING-0} : { *(.rel.init) }
|
|
|
|
.rela.init ${RELOCATING-0} : { *(.rela.init) }
|
|
|
|
.rel.text ${RELOCATING-0} :
|
2002-05-16 19:51:08 +00:00
|
|
|
{
|
|
|
|
*(.rel.text)
|
|
|
|
${RELOCATING+*(.rel.text.*)}
|
|
|
|
${RELOCATING+*(.rel.gnu.linkonce.t*)}
|
|
|
|
}
|
2009-10-10 04:34:39 +00:00
|
|
|
.rela.text ${RELOCATING-0} :
|
2002-05-16 19:51:08 +00:00
|
|
|
{
|
|
|
|
*(.rela.text)
|
|
|
|
${RELOCATING+*(.rela.text.*)}
|
|
|
|
${RELOCATING+*(.rela.gnu.linkonce.t*)}
|
|
|
|
}
|
2009-10-10 04:34:39 +00:00
|
|
|
.rel.fini ${RELOCATING-0} : { *(.rel.fini) }
|
|
|
|
.rela.fini ${RELOCATING-0} : { *(.rela.fini) }
|
|
|
|
.rel.rodata ${RELOCATING-0} :
|
2002-05-16 19:51:08 +00:00
|
|
|
{
|
|
|
|
*(.rel.rodata)
|
|
|
|
${RELOCATING+*(.rel.rodata.*)}
|
|
|
|
${RELOCATING+*(.rel.gnu.linkonce.r*)}
|
|
|
|
}
|
2009-10-10 04:34:39 +00:00
|
|
|
.rela.rodata ${RELOCATING-0} :
|
2002-05-16 19:51:08 +00:00
|
|
|
{
|
|
|
|
*(.rela.rodata)
|
|
|
|
${RELOCATING+*(.rela.rodata.*)}
|
|
|
|
${RELOCATING+*(.rela.gnu.linkonce.r*)}
|
|
|
|
}
|
2009-10-10 04:34:39 +00:00
|
|
|
.rel.data ${RELOCATING-0} :
|
2002-05-16 19:51:08 +00:00
|
|
|
{
|
|
|
|
*(.rel.data)
|
|
|
|
${RELOCATING+*(.rel.data.*)}
|
|
|
|
${RELOCATING+*(.rel.gnu.linkonce.d*)}
|
|
|
|
}
|
2009-10-10 04:34:39 +00:00
|
|
|
.rela.data ${RELOCATING-0} :
|
2002-05-16 19:51:08 +00:00
|
|
|
{
|
|
|
|
*(.rela.data)
|
|
|
|
${RELOCATING+*(.rela.data.*)}
|
|
|
|
${RELOCATING+*(.rela.gnu.linkonce.d*)}
|
|
|
|
}
|
2009-10-10 04:34:39 +00:00
|
|
|
.rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
|
|
|
|
.rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
|
|
|
|
.rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
|
|
|
|
.rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
|
|
|
|
.rel.got ${RELOCATING-0} : { *(.rel.got) }
|
|
|
|
.rela.got ${RELOCATING-0} : { *(.rela.got) }
|
|
|
|
.rel.bss ${RELOCATING-0} : { *(.rel.bss) }
|
|
|
|
.rela.bss ${RELOCATING-0} : { *(.rela.bss) }
|
|
|
|
.rel.plt ${RELOCATING-0} : { *(.rel.plt) }
|
|
|
|
.rela.plt ${RELOCATING-0} : { *(.rela.plt) }
|
2002-05-16 19:51:08 +00:00
|
|
|
|
2006-05-24 07:36:12 +00:00
|
|
|
/* Internal text space or external memory. */
|
2009-10-10 04:34:39 +00:00
|
|
|
.text ${RELOCATING-0} :
|
2002-05-16 19:51:08 +00:00
|
|
|
{
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.vectors)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP(*(.vectors))
|
2002-06-01 23:28:59 +00:00
|
|
|
|
2006-05-24 07:36:12 +00:00
|
|
|
/* For data that needs to reside in the lower 64k of progmem. */
|
|
|
|
*(.progmem.gcc*)
|
|
|
|
*(.progmem*)
|
|
|
|
${RELOCATING+. = ALIGN(2);}
|
|
|
|
|
|
|
|
${CONSTRUCTING+ __trampolines_start = . ; }
|
|
|
|
/* The jump trampolines for the 16-bit limited relocs will reside here. */
|
|
|
|
*(.trampolines)
|
|
|
|
*(.trampolines*)
|
|
|
|
${CONSTRUCTING+ __trampolines_end = . ; }
|
|
|
|
|
|
|
|
/* For future tablejump instruction arrays for 3 byte pc devices.
|
|
|
|
We don't relax jump/call instructions within these sections. */
|
|
|
|
*(.jumptables)
|
|
|
|
*(.jumptables*)
|
|
|
|
|
|
|
|
/* For code that needs to reside in the lower 128k progmem. */
|
|
|
|
*(.lowtext)
|
|
|
|
*(.lowtext*)
|
|
|
|
|
2002-06-01 23:28:59 +00:00
|
|
|
${CONSTRUCTING+ __ctors_start = . ; }
|
|
|
|
${CONSTRUCTING+ *(.ctors) }
|
|
|
|
${CONSTRUCTING+ __ctors_end = . ; }
|
|
|
|
${CONSTRUCTING+ __dtors_start = . ; }
|
|
|
|
${CONSTRUCTING+ *(.dtors) }
|
|
|
|
${CONSTRUCTING+ __dtors_end = . ; }
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP(SORT(*)(.ctors))
|
|
|
|
KEEP(SORT(*)(.dtors))
|
2002-06-01 23:28:59 +00:00
|
|
|
|
2006-05-24 07:36:12 +00:00
|
|
|
/* From this point on, we don't bother about wether the insns are
|
|
|
|
below or above the 16 bits boundary. */
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.init0) /* Start here after reset. */
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.init0))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.init1)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.init1))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.init2) /* Clear __zero_reg__, set up stack pointer. */
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.init2))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.init3)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.init3))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.init4) /* Initialize data and BSS. */
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.init4))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.init5)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.init5))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.init6) /* C++ constructors. */
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.init6))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.init7)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.init7))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.init8)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.init8))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.init9) /* Call main(). */
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.init9))
|
2002-05-16 19:51:08 +00:00
|
|
|
*(.text)
|
|
|
|
${RELOCATING+. = ALIGN(2);}
|
|
|
|
*(.text.*)
|
|
|
|
${RELOCATING+. = ALIGN(2);}
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.fini9) /* _exit() starts here. */
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.fini9))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.fini8)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.fini8))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.fini7)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.fini7))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.fini6) /* C++ destructors. */
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.fini6))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.fini5)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.fini5))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.fini4)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.fini4))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.fini3)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.fini3))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.fini2)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.fini2))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.fini1)
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.fini1))
|
2002-06-01 23:28:59 +00:00
|
|
|
*(.fini0) /* Infinite loop after program termination. */
|
2006-03-03 15:25:31 +00:00
|
|
|
KEEP (*(.fini0))
|
2002-05-16 19:51:08 +00:00
|
|
|
${RELOCATING+ _etext = . ; }
|
|
|
|
} ${RELOCATING+ > text}
|
|
|
|
|
2009-10-10 04:34:39 +00:00
|
|
|
.data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
|
2002-05-16 19:51:08 +00:00
|
|
|
{
|
|
|
|
${RELOCATING+ PROVIDE (__data_start = .) ; }
|
|
|
|
*(.data)
|
2006-03-03 15:25:31 +00:00
|
|
|
*(.data*)
|
|
|
|
*(.rodata) /* We need to include .rodata here if gcc is used */
|
|
|
|
*(.rodata*) /* with -fdata-sections. */
|
2002-05-16 19:51:08 +00:00
|
|
|
*(.gnu.linkonce.d*)
|
|
|
|
${RELOCATING+. = ALIGN(2);}
|
|
|
|
${RELOCATING+ _edata = . ; }
|
2002-06-01 23:28:59 +00:00
|
|
|
${RELOCATING+ PROVIDE (__data_end = .) ; }
|
2002-05-16 19:51:08 +00:00
|
|
|
} ${RELOCATING+ > data}
|
|
|
|
|
2009-10-10 04:34:39 +00:00
|
|
|
.bss ${RELOCATING-0} :${RELOCATING+ AT (ADDR (.bss))}
|
2002-05-16 19:51:08 +00:00
|
|
|
{
|
|
|
|
${RELOCATING+ PROVIDE (__bss_start = .) ; }
|
|
|
|
*(.bss)
|
2006-03-03 15:25:31 +00:00
|
|
|
*(.bss*)
|
2002-05-16 19:51:08 +00:00
|
|
|
*(COMMON)
|
|
|
|
${RELOCATING+ PROVIDE (__bss_end = .) ; }
|
2002-06-01 23:28:59 +00:00
|
|
|
} ${RELOCATING+ > data}
|
|
|
|
|
|
|
|
${RELOCATING+ __data_load_start = LOADADDR(.data); }
|
|
|
|
${RELOCATING+ __data_load_end = __data_load_start + SIZEOF(.data); }
|
|
|
|
|
|
|
|
/* Global data not cleared after reset. */
|
2009-10-10 04:34:39 +00:00
|
|
|
.noinit ${RELOCATING-0}:
|
2002-06-01 23:28:59 +00:00
|
|
|
{
|
|
|
|
${RELOCATING+ PROVIDE (__noinit_start = .) ; }
|
|
|
|
*(.noinit*)
|
|
|
|
${RELOCATING+ PROVIDE (__noinit_end = .) ; }
|
2002-05-16 19:51:08 +00:00
|
|
|
${RELOCATING+ _end = . ; }
|
2002-06-01 23:28:59 +00:00
|
|
|
${RELOCATING+ PROVIDE (__heap_start = .) ; }
|
2002-05-16 19:51:08 +00:00
|
|
|
} ${RELOCATING+ > data}
|
|
|
|
|
2009-10-10 04:34:39 +00:00
|
|
|
.eeprom ${RELOCATING-0}:
|
2002-05-16 19:51:08 +00:00
|
|
|
{
|
|
|
|
*(.eeprom*)
|
|
|
|
${RELOCATING+ __eeprom_end = . ; }
|
|
|
|
} ${RELOCATING+ > eeprom}
|
|
|
|
|
2011-03-21 20:07:42 +00:00
|
|
|
.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}
|
|
|
|
|
2002-05-16 19:51:08 +00:00
|
|
|
/* Stabs debugging sections. */
|
|
|
|
.stab 0 : { *(.stab) }
|
|
|
|
.stabstr 0 : { *(.stabstr) }
|
|
|
|
.stab.excl 0 : { *(.stab.excl) }
|
|
|
|
.stab.exclstr 0 : { *(.stab.exclstr) }
|
|
|
|
.stab.index 0 : { *(.stab.index) }
|
|
|
|
.stab.indexstr 0 : { *(.stab.indexstr) }
|
|
|
|
.comment 0 : { *(.comment) }
|
|
|
|
|
|
|
|
/* DWARF debug sections.
|
|
|
|
Symbols in the DWARF debugging sections are relative to the beginning
|
|
|
|
of the section so we begin them at 0. */
|
|
|
|
|
|
|
|
/* DWARF 1 */
|
|
|
|
.debug 0 : { *(.debug) }
|
|
|
|
.line 0 : { *(.line) }
|
|
|
|
|
|
|
|
/* GNU DWARF 1 extensions */
|
2011-02-10 08:18:58 +00:00
|
|
|
.debug_srcinfo 0 : { *(.debug_srcinfo) }
|
|
|
|
.debug_sfnames 0 : { *(.debug_sfnames) }
|
2002-05-16 19:51:08 +00:00
|
|
|
|
|
|
|
/* DWARF 1.1 and DWARF 2 */
|
2011-02-10 08:18:58 +00:00
|
|
|
.debug_aranges 0 : { *(.debug_aranges) }
|
|
|
|
.debug_pubnames 0 : { *(.debug_pubnames) }
|
2002-05-16 19:51:08 +00:00
|
|
|
|
|
|
|
/* DWARF 2 */
|
2011-02-10 08:18:58 +00:00
|
|
|
.debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
|
|
|
|
.debug_abbrev 0 : { *(.debug_abbrev) }
|
|
|
|
.debug_line 0 : { *(.debug_line) }
|
|
|
|
.debug_frame 0 : { *(.debug_frame) }
|
|
|
|
.debug_str 0 : { *(.debug_str) }
|
|
|
|
.debug_loc 0 : { *(.debug_loc) }
|
|
|
|
.debug_macinfo 0 : { *(.debug_macinfo) }
|
2002-05-16 19:51:08 +00:00
|
|
|
}
|
|
|
|
EOF
|
|
|
|
|