Update from Eric Norum to include C++ support.

This commit is contained in:
Joel Sherrill
1997-12-20 16:37:29 +00:00
parent f7fa7d76ce
commit 1587af614b
3 changed files with 281 additions and 239 deletions

View File

@@ -1,117 +1,131 @@
/* /*
* This file contains GNU linker directives for a generic MC68360 board. * This file contains GNU linker directives for a generic MC68360 board.
* Variations in memory size and allocation can be made by * Variations in memory size and allocation can be made by
* overriding some values with linker command-line arguments. * overriding some values with linker command-line arguments.
* *
* Saskatchewan Accelerator Laboratory * Saskatchewan Accelerator Laboratory
* University of Saskatchewan * University of Saskatchewan
* Saskatoon, Saskatchewan, CANADA * Saskatoon, Saskatchewan, CANADA
* eric@skatter.usask.ca * eric@skatter.usask.ca
* *
* $Id$ * $Id$
*/ */
/* /*
* Declare some sizes. * Declare some sizes.
* XXX: The assignment of ". += XyzSize;" fails in older gld's if the * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
* number used there is not constant. If this happens to you, edit * number used there is not constant. If this happens to you, edit
* the lines marked XXX below to use a constant value. * the lines marked XXX below to use a constant value.
*/ */
RamSize = DEFINED(RamSize) ? RamSize : 4M; RamSize = DEFINED(RamSize) ? RamSize : 4M;
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
/* /*
* Declare on-board memory. * Declare on-board memory.
* It would be nice if the ram length could be given as * It would be nice if the ram length could be given as
* LENGTH=RamSize, but gld doesn't allow non-constant * LENGTH=RamSize, but gld doesn't allow non-constant
* values in the LENGTH expression. * values in the LENGTH expression.
*/ */
MEMORY { MEMORY {
ram : ORIGIN = 0x00000000, LENGTH = 64M ram : ORIGIN = 0x00000000, LENGTH = 64M
rom : ORIGIN = 0x0F000000, LENGTH = 1M rom : ORIGIN = 0x0F000000, LENGTH = 1M
dpram : ORIGIN = 0x0E000000, LENGTH = 8k dpram : ORIGIN = 0x0E000000, LENGTH = 8k
} }
/* /*
* Declare low-order three octets of Ethernet address. * Declare low-order three octets of Ethernet address.
*/ */
ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12; ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
/* /*
* Load objects * Load objects
*/ */
SECTIONS { SECTIONS {
/* /*
* Hardware variations * Hardware variations
*/ */
_RamSize = RamSize; _RamSize = RamSize;
__RamSize = RamSize; __RamSize = RamSize;
/* /*
* Boot PROM * Boot PROM
*/ */
rom : { rom : {
_RomBase = .; _RomBase = .;
__RomBase = .; __RomBase = .;
} >rom } >rom
/* /*
* Dynamic RAM * Dynamic RAM
*/ */
ram : { ram : {
_RamBase = .; _RamBase = .;
__RamBase = .; __RamBase = .;
} >ram } >ram
/* /*
* Text, data and bss segments * Text, data and bss segments
*/ */
.text : { .text : {
CREATE_OBJECT_SYMBOLS CREATE_OBJECT_SYMBOLS
*(.text) *(.text)
. = ALIGN (16); . = ALIGN (16);
etext = .; etext = .;
_etext = .; _etext = .;
} >ram
.data : { /*
copy_start = .; * C++ constructors
*(.data) */
. = ALIGN (16); __CTOR_LIST__ = .;
_edata = .; LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
copy_end = .; *(.ctors)
} >ram LONG(0)
.bss : { __CTOR_END__ = .;
M68Kvec = .; __DTOR_LIST__ = .;
_M68Kvec = .; LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
. += (256 * 4); *(.dtors)
clear_start = .; LONG(0)
*(.bss) __DTOR_END__ = .;
*(COMMON) } >ram
. = ALIGN (16); .data : {
_end = .; copy_start = .;
*(.data)
_HeapStart = .; . = ALIGN (16);
__HeapStart = .; _edata = .;
. += HeapSize; /* XXX -- Old gld can't handle this */ copy_end = .;
. += StackSize; /* XXX -- Old gld can't handle this */ } >ram
/* . += 0x10000; */ /* HeapSize for old gld */ .bss : {
/* . += 0x1000; */ /* StackSize for old gld */ M68Kvec = .;
. = ALIGN (16); _M68Kvec = .;
stack_init = .; . += (256 * 4);
clear_end = .; clear_start = .;
*(.bss)
_WorkspaceBase = .; *(COMMON)
__WorkspaceBase = .; . = ALIGN (16);
} >ram _end = .;
/* _HeapStart = .;
* On-chip memory/peripherals __HeapStart = .;
*/ . += HeapSize; /* XXX -- Old gld can't handle this */
dpram : { . += StackSize; /* XXX -- Old gld can't handle this */
m360 = .; /* . += 0x10000; */ /* HeapSize for old gld */
_m360 = .; /* . += 0x1000; */ /* StackSize for old gld */
. += (8 * 1024); . = ALIGN (16);
stack_init = .;
} >dpram clear_end = .;
}
_WorkspaceBase = .;
__WorkspaceBase = .;
} >ram
/*
* On-chip memory/peripherals
*/
dpram : {
m360 = .;
_m360 = .;
. += (8 * 1024);
} >dpram
}

View File

@@ -1,122 +1,136 @@
/* /*
* This file contains GNU linker directives for a generic MC68360 board. * This file contains GNU linker directives for a generic MC68360 board.
* Variations in hardware type and dynamic memory size can be made * Variations in hardware type and dynamic memory size can be made
* by overriding some values with linker command-line arguments. * by overriding some values with linker command-line arguments.
* *
* These linker directives are for producing a PROM version. * These linker directives are for producing a PROM version.
* The data segment is placed at the end of the text segment in the PROM. * The data segment is placed at the end of the text segment in the PROM.
* The start-up code takes care of copying this region to RAM. * The start-up code takes care of copying this region to RAM.
* *
* Saskatchewan Accelerator Laboratory * Saskatchewan Accelerator Laboratory
* University of Saskatchewan * University of Saskatchewan
* Saskatoon, Saskatchewan, CANADA * Saskatoon, Saskatchewan, CANADA
* eric@skatter.usask.ca * eric@skatter.usask.ca
* *
* $Id$ * $Id$
*/ */
/* /*
* Declare some sizes. * Declare some sizes.
* XXX: The assignment of ". += XyzSize;" fails in older gld's if the * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
* number used there is not constant. If this happens to you, edit * number used there is not constant. If this happens to you, edit
* the lines marked XXX below to use a constant value. * the lines marked XXX below to use a constant value.
*/ */
RamSize = DEFINED(RamSize) ? RamSize : 4M; RamSize = DEFINED(RamSize) ? RamSize : 4M;
HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
StackSize = DEFINED(StackSize) ? StackSize : 0x1000; StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
/* /*
* Declare on-board memory. * Declare on-board memory.
* It would be nice if the ram length could be given as * It would be nice if the ram length could be given as
* LENGTH=RamSize, but gld doesn't allow non-constant * LENGTH=RamSize, but gld doesn't allow non-constant
* values in the LENGTH expression. * values in the LENGTH expression.
*/ */
MEMORY { MEMORY {
ram : ORIGIN = 0x00000000, LENGTH = 64M ram : ORIGIN = 0x00000000, LENGTH = 64M
myram : ORIGIN = 4M-512k, LENGTH = 512k myram : ORIGIN = 4M-512k, LENGTH = 512k
rom : ORIGIN = 0x0F000000, LENGTH = 1M rom : ORIGIN = 0x0F000000, LENGTH = 1M
dpram : ORIGIN = 0x0E000000, LENGTH = 8k dpram : ORIGIN = 0x0E000000, LENGTH = 8k
} }
/* /*
* Declare low-order three octets of Ethernet address. * Declare low-order three octets of Ethernet address.
*/ */
ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12; ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
/* /*
* Load objects * Load objects
*/ */
SECTIONS { SECTIONS {
/* /*
* Hardware variations * Hardware variations
*/ */
_RamSize = RamSize; _RamSize = RamSize;
__RamSize = RamSize; __RamSize = RamSize;
/* /*
* Boot PROM * Boot PROM
*/ */
rom : { rom : {
_RomBase = .; _RomBase = .;
__RomBase = .; __RomBase = .;
} >rom } >rom
/* /*
* Dynamic RAM * Dynamic RAM
*/ */
ram : { ram : {
_RamBase = .; _RamBase = .;
__RamBase = .; __RamBase = .;
} >ram } >ram
/* /*
* Text, data and bss segments * Text, data and bss segments
*/ */
.text : AT (0x00000000) { .text : AT (0x00000000) {
CREATE_OBJECT_SYMBOLS CREATE_OBJECT_SYMBOLS
*(.text) *(.text)
. = ALIGN (16); . = ALIGN (16);
etext = .; etext = .;
_etext = .; _etext = .;
} >rom
.data : AT(SIZEOF(.text)) { /*
copy_start = .; * C++ constructors
*(.data) */
. = ALIGN (16); __CTOR_LIST__ = .;
_edata = .; LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
copy_end = .; *(.ctors)
} >myram LONG(0)
.bss : { __CTOR_END__ = .;
M68Kvec = .; __DTOR_LIST__ = .;
_M68Kvec = .; LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
. += (256 * 4); *(.dtors)
clear_start = .; LONG(0)
*(.bss) __DTOR_END__ = .;
*(COMMON) } >rom
. = ALIGN (16); .data : AT(SIZEOF(.text)) {
_end = .; copy_start = .;
*(.data)
_HeapStart = .; . = ALIGN (16);
__HeapStart = .; _edata = .;
. += HeapSize; /* XXX -- Old gld can't handle this */ copy_end = .;
. += StackSize; /* XXX -- Old gld can't handle this */ } >myram
/* . += 0x10000; */ /* HeapSize for old gld */ .bss : {
/* . += 0x1000; */ /* StackSize for old gld */ M68Kvec = .;
. = ALIGN (16); _M68Kvec = .;
stack_init = .; . += (256 * 4);
clear_end = .; clear_start = .;
*(.bss)
_WorkspaceBase = .; *(COMMON)
__WorkspaceBase = .; . = ALIGN (16);
} >myram _end = .;
/* _HeapStart = .;
* On-chip memory/peripherals __HeapStart = .;
*/ . += HeapSize; /* XXX -- Old gld can't handle this */
dpram : { . += StackSize; /* XXX -- Old gld can't handle this */
m360 = .; /* . += 0x10000; */ /* HeapSize for old gld */
_m360 = .; /* . += 0x1000; */ /* StackSize for old gld */
. += (8 * 1024); . = ALIGN (16);
stack_init = .;
} >dpram clear_end = .;
}
_WorkspaceBase = .;
__WorkspaceBase = .;
} >myram
/*
* On-chip memory/peripherals
*/
dpram : {
m360 = .;
_m360 = .;
. += (8 * 1024);
} >dpram
}

View File

@@ -106,6 +106,20 @@ SECTIONS {
. = ALIGN (16); . = ALIGN (16);
etext = .; etext = .;
_etext = .; _etext = .;
/*
* C++ constructors
*/
__CTOR_LIST__ = .;
LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
*(.ctors)
LONG(0)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
*(.dtors)
LONG(0)
__DTOR_END__ = .;
} >rom } >rom
.data : { .data : {
copy_start = .; copy_start = .;