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

4.104.114.84.95
Last change on this file since a858910 was c257ec4e, checked in by Joel Sherrill <joel.sherrill@…>, on 12/22/97 at 18:23:58

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.4 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
80                /*
81                 * C++ constructors
82                 */
83                __CTOR_LIST__ = .;
84                LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
85                *(.ctors)
86                LONG(0)
87                __CTOR_END__ = .;
88                __DTOR_LIST__ = .;
89                LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
90                *(.dtors)
91                LONG(0)
92                __DTOR_END__ = .;
93
94                etext = .;
95                _etext = .;
96        } >rom
97        .data : AT(SIZEOF(.text)) {
98                copy_start = .;
99                *(.data)
100                . = ALIGN (16);
101                _edata = .;
102                copy_end = .;
103        } >myram
104        .bss : {
105                M68Kvec = .;
106                _M68Kvec = .;
107                . += (256 * 4);
108                clear_start = .;
109                *(.bss)
110                *(COMMON)
111                . = ALIGN (16);
112                _end = .;
113
114                _HeapStart = .;
115                __HeapStart = .;
116                . += HeapSize;  /* XXX -- Old gld can't handle this */
117                . += StackSize; /* XXX -- Old gld can't handle this */
118                /* . += 0x10000; */ /* HeapSize for old gld */
119                /* . += 0x1000;  */ /* StackSize for old gld */
120                . = ALIGN (16);
121                stack_init = .;
122                clear_end = .;
123
124                _WorkspaceBase = .;
125                __WorkspaceBase = .;
126        } >myram
127
128        /*
129         * On-chip memory/peripherals
130         */
131        dpram : {
132                m360 = .;
133                _m360 = .;
134                . += (8 * 1024);
135
136        } >dpram
137}
Note: See TracBrowser for help on using the repository browser.