source: rtems/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.bootp @ 1587af6

4.104.114.84.95
Last change on this file since 1587af6 was 1587af6, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 20, 1997 at 4:37:29 PM

Update from Eric Norum to include C++ support.

  • Property mode set to 100644
File size: 3.6 KB
Line 
1/*
2 * This file contains GNU linker directives for a generic MC68360 board.
3 * Variations in hardware type and dynamic memory size can be made
4 * by overriding some values with linker command-line arguments.
5 *
6 * These linker directives are for producing a PROM version.
7 * The data segment is placed at the end of the text segment in the PROM.
8 * The start-up code takes care of copying this region to RAM.
9 *
10 * Saskatchewan Accelerator Laboratory
11 * University of Saskatchewan
12 * Saskatoon, Saskatchewan, CANADA
13 * eric@skatter.usask.ca
14 *
15 *  $Id$
16 */
17
18/*
19 * Declare some sizes.
20 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
21 *      number used there is not constant.  If this happens to you, edit
22 *      the lines marked XXX below to use a constant value.
23 */
24RamSize = DEFINED(RamSize) ? RamSize : 4M;
25HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
26StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
27
28/*
29 * Declare on-board memory.
30 * It would be nice if the ram length could be given as
31 * LENGTH=RamSize, but gld doesn't allow non-constant
32 * values in the LENGTH expression. 
33 */
34MEMORY {
35          ram : ORIGIN = 0x00000000, LENGTH = 64M
36        myram : ORIGIN = 4M-512k,    LENGTH = 512k
37          rom : ORIGIN = 0x0F000000, LENGTH = 1M
38        dpram : ORIGIN = 0x0E000000, LENGTH = 8k
39}
40
41/*
42 * Declare low-order three octets of Ethernet address.
43 */
44ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
45
46/*
47 * Load objects
48 */
49SECTIONS {
50        /*
51         * Hardware variations
52         */
53        _RamSize = RamSize;
54        __RamSize = RamSize;
55
56        /*
57         * Boot PROM
58         */
59        rom : {
60                _RomBase = .;
61                __RomBase = .;
62        } >rom
63
64        /*
65         * Dynamic RAM
66         */
67        ram : {
68                _RamBase = .;
69                __RamBase = .;
70        } >ram
71
72        /*
73         * Text, data and bss segments
74         */
75        .text : AT (0x00000000) {
76                CREATE_OBJECT_SYMBOLS
77                *(.text)
78                . = ALIGN (16);
79                etext = .;
80                _etext = .;
81
82                /*
83                 * C++ constructors
84                 */
85                __CTOR_LIST__ = .;
86                LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
87                *(.ctors)
88                LONG(0)
89                __CTOR_END__ = .;
90                __DTOR_LIST__ = .;
91                LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
92                *(.dtors)
93                LONG(0)
94                __DTOR_END__ = .;
95        } >rom
96        .data : AT(SIZEOF(.text)) {
97                copy_start = .;
98                *(.data)
99                . = ALIGN (16);
100                _edata = .;
101                copy_end = .;
102        } >myram
103        .bss : {
104                M68Kvec = .;
105                _M68Kvec = .;
106                . += (256 * 4);
107                clear_start = .;
108                *(.bss)
109                *(COMMON)
110                . = ALIGN (16);
111                _end = .;
112
113                _HeapStart = .;
114                __HeapStart = .;
115                . += HeapSize;  /* XXX -- Old gld can't handle this */
116                . += StackSize; /* XXX -- Old gld can't handle this */
117                /* . += 0x10000; */ /* HeapSize for old gld */
118                /* . += 0x1000;  */ /* StackSize for old gld */
119                . = ALIGN (16);
120                stack_init = .;
121                clear_end = .;
122
123                _WorkspaceBase = .;
124                __WorkspaceBase = .;
125        } >myram
126
127        /*
128         * On-chip memory/peripherals
129         */
130        dpram : {
131                m360 = .;
132                _m360 = .;
133                . += (8 * 1024);
134
135        } >dpram
136}
Note: See TracBrowser for help on using the repository browser.