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
|
|
|
|
OUTPUT_FORMAT("${OUTPUT_FORMAT}")
|
|
|
|
OUTPUT_ARCH(h8300h)
|
|
|
|
ENTRY("_start")
|
|
|
|
|
|
|
|
/* The memory size is 256KB to coincide with the simulator.
|
|
|
|
Don't change either without considering the other. */
|
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
2001-01-10 12:42:27 +01:00
|
|
|
/* 0xc4 is a magic entry. We should have the linker just
|
|
|
|
skip over it one day... */
|
|
|
|
vectors : o = 0x0000, l = 0xc4
|
|
|
|
magicvectors : o = 0xc4, l = 0x3c
|
1999-05-03 09:29:11 +02:00
|
|
|
/* We still only use 256k as the main ram size. */
|
|
|
|
ram : o = 0x0100, l = 0x3fefc
|
|
|
|
/* The stack starts at the top of main ram. */
|
|
|
|
topram : o = 0x3fffc, l = 0x4
|
|
|
|
/* This holds variables in the "tiny" sections. */
|
|
|
|
tiny : o = 0xff8000, l = 0x7f00
|
|
|
|
/* At the very top of the address space is the 8-bit area. */
|
|
|
|
eight : o = 0xffff00, l = 0x100
|
|
|
|
}
|
|
|
|
|
2001-01-10 12:42:27 +01:00
|
|
|
SECTIONS
|
|
|
|
{
|
2000-11-03 20:49:05 +01:00
|
|
|
.vectors :
|
|
|
|
{
|
|
|
|
/* Use something like this to place a specific
|
|
|
|
function's address into the vector table.
|
1999-05-03 09:29:11 +02:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
LONG (ABSOLUTE (_foobar)). */
|
1999-05-03 09:29:11 +02:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
*(.vectors)
|
1999-05-03 09:29:11 +02:00
|
|
|
} ${RELOCATING+ > vectors}
|
2001-01-10 12:42:27 +01:00
|
|
|
|
2000-11-03 20:49:05 +01:00
|
|
|
.text :
|
2001-01-10 12:42:27 +01:00
|
|
|
{
|
|
|
|
*(.rodata)
|
|
|
|
*(.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)
|
|
|
|
${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
|
|
|
.tiny :
|
|
|
|
{
|
|
|
|
*(.tiny)
|
1999-05-03 09:29:11 +02:00
|
|
|
} ${RELOCATING+ > tiny}
|
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
|