source: rtems/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds @ a858910

4.104.114.84.95
Last change on this file since a858910 was c257ec4e, checked in by Joel Sherrill <joel.sherrill@…>, on Dec 22, 1997 at 6:23:58 PM

Fixes from Eric Norum. C++ support added in previous version was broken:

1) In my haste to add C++ constructor/destructors to the 68360
linkcmds scripts I managed to break all existing 68360 programs.
Linker scripts which actually produce a working executable are
contained below. The problem was that the constructor/destructors
weren't included before the etext symbol.

On top of that Eric and I appear to have problems with attachments:

2) In deciphering the above problem I think I stumbled across the
reason you've had with patches mailed from me. I noticed that the
linkcmds (and linkcmds.bootp) scripts in the latest distribution have
a control-M (carriage return) at the end of each line. Could you
check the files below before installing them in the distribution and
see that there aren't returns in the files? Maybe if I send
everything as a tar attatchment things will work better.

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