2015-01-01 15:15:26 +01:00
|
|
|
# Copyright (C) 2014-2015 Free Software Foundation, Inc.
|
2014-08-20 11:34:58 +02:00
|
|
|
#
|
|
|
|
# Copying and distribution of this file, with or without modification,
|
|
|
|
# are permitted in any medium without royalty provided the copyright
|
|
|
|
# notice and this notice are preserved.
|
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
TORS=".tors :
|
2000-11-14 20:17:53 +01:00
|
|
|
{
|
|
|
|
___ctors = . ;
|
|
|
|
*(.ctors)
|
|
|
|
___ctors_end = . ;
|
|
|
|
___dtors = . ;
|
|
|
|
*(.dtors)
|
|
|
|
___dtors_end = . ;
|
|
|
|
} > ram"
|
2000-11-03 20:49:05 +01:00
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
cat <<EOF
|
2015-01-01 15:15:26 +01:00
|
|
|
/* Copyright (C) 2014-2015 Free Software Foundation, Inc.
|
2014-08-20 11:34:58 +02:00
|
|
|
|
|
|
|
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. */
|
|
|
|
|
1999-05-03 09:29:11 +02:00
|
|
|
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
|
|
|
|
OUTPUT_ARCH(${ARCH})
|
2009-09-09 13:59:14 +02:00
|
|
|
${RELOCATING+ENTRY ("_start")}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
/* 0xc4 is a magic entry. We should have the linker just
|
2001-01-10 12:42:27 +01:00
|
|
|
skip over it one day... */
|
1999-05-03 09:29:11 +02:00
|
|
|
vectors : o = 0x0000, l = 0xc4
|
|
|
|
magicvectors : o = 0xc4, l = 0x3c
|
|
|
|
ram : o = 0x0100, l = 0xfdfc
|
|
|
|
/* The stack starts at the top of main ram. */
|
|
|
|
topram : o = 0xfefc, l = 0x4
|
2001-01-10 12:42:27 +01:00
|
|
|
/* At the very top of the address space is the 8-bit area. */
|
1999-05-03 09:29:11 +02:00
|
|
|
eight : o = 0xff00, l = 0x100
|
|
|
|
}
|
|
|
|
|
2001-01-10 12:42:27 +01:00
|
|
|
SECTIONS
|
|
|
|
{
|
2000-11-03 20:49:05 +01:00
|
|
|
.vectors :
|
2000-11-14 20:17:53 +01:00
|
|
|
{
|
2000-11-03 20:49:05 +01:00
|
|
|
/* Use something like this to place a specific
|
2001-01-10 12:42:27 +01:00
|
|
|
function's address into the vector table.
|
1999-05-03 09:29:11 +02:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
SHORT (ABSOLUTE (_foobar)). */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
*(.vectors)
|
2000-11-14 20:17:53 +01:00
|
|
|
} ${RELOCATING+ > vectors}
|
1999-05-03 09:29:11 +02:00
|
|
|
|
2003-04-24 14:36:08 +02:00
|
|
|
.init :
|
|
|
|
{
|
|
|
|
*(.init)
|
|
|
|
} ${RELOCATING+ > ram}
|
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
.text :
|
2001-01-10 12:42:27 +01:00
|
|
|
{
|
|
|
|
*(.rodata)
|
|
|
|
*(.text)
|
2003-04-24 14:36:08 +02:00
|
|
|
*(.text.*)
|
2000-11-03 20:49:05 +01:00
|
|
|
*(.strings)
|
|
|
|
${RELOCATING+ _etext = . ; }
|
1999-05-03 09:29:11 +02:00
|
|
|
} ${RELOCATING+ > ram}
|
2001-01-10 12:42:27 +01:00
|
|
|
|
2000-11-14 20:17:53 +01:00
|
|
|
${CONSTRUCTING+${TORS}}
|
2001-01-10 12:42:27 +01:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
.data :
|
|
|
|
{
|
|
|
|
*(.data)
|
2003-04-24 14:36:08 +02:00
|
|
|
*(.data.*)
|
2000-11-03 20:49:05 +01:00
|
|
|
*(.tiny)
|
|
|
|
${RELOCATING+ _edata = . ; }
|
1999-05-03 09:29:11 +02:00
|
|
|
} ${RELOCATING+ > ram}
|
2001-01-10 12:42:27 +01:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
.bss :
|
|
|
|
{
|
|
|
|
${RELOCATING+ _bss_start = . ;}
|
|
|
|
*(.bss)
|
|
|
|
*(COMMON)
|
|
|
|
${RELOCATING+ _end = . ; }
|
1999-05-03 09:29:11 +02:00
|
|
|
} ${RELOCATING+ >ram}
|
2001-01-10 12:42:27 +01:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
.stack :
|
|
|
|
{
|
|
|
|
${RELOCATING+ _stack = . ; }
|
|
|
|
*(.stack)
|
1999-05-03 09:29:11 +02:00
|
|
|
} ${RELOCATING+ > topram}
|
2001-01-10 12:42:27 +01:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
.eight :
|
|
|
|
{
|
|
|
|
*(.eight)
|
1999-05-03 09:29:11 +02:00
|
|
|
} ${RELOCATING+ > eight}
|
2001-01-10 12:42:27 +01:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
.stab 0 ${RELOCATING+(NOLOAD)} :
|
|
|
|
{
|
|
|
|
[ .stab ]
|
1999-05-03 09:29:11 +02:00
|
|
|
}
|
2001-01-10 12:42:27 +01:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
.stabstr 0 ${RELOCATING+(NOLOAD)} :
|
|
|
|
{
|
|
|
|
[ .stabstr ]
|
1999-05-03 09:29:11 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
EOF
|