source: rtems/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom @ 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.5 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 BOOTP PROM.
7 * To create the PROM image from the linker output you must use objcopy
8 * (--adjust-section-vma) to place the data segment at the end of the text
9 * segment in the PROM.  The start-up code takes care of copying this region
10 * to RAM.
11 *
12 * Saskatchewan Accelerator Laboratory
13 * University of Saskatchewan
14 * Saskatoon, Saskatchewan, CANADA
15 * eric@skatter.usask.ca
16 *
17 *  $Id$
18 */
19
20/*
21 * a.out format doesn't handle prom images very well
22 */
23OUTPUT_FORMAT(coff-m68k)
24
25/*
26 * Declare some sizes.
27 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
28 *      number used there is not constant.  If this happens to you, edit
29 *      the lines marked XXX below to use a constant value.
30 */
31RamSize = DEFINED(RamSize) ? RamSize : 4M;
32HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
33StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
34
35/*
36 * Declare on-board memory.
37 * It would be nice if the ram length could be given as
38 * LENGTH=RamSize, but gld doesn't allow non-constant
39 * values in the LENGTH expression. 
40 */
41MEMORY {
42          ram : ORIGIN = 0x00000000, LENGTH = 64M
43          rom : ORIGIN = 0xFF000000, LENGTH = 1M
44        dpram : ORIGIN = 0xFE000000, LENGTH = 8k
45}
46
47/*
48 * Declare low-order three octets of Ethernet address.
49 */
50ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
51
52/*
53 * Load objects
54 */
55SECTIONS {
56        /*
57         * Hardware variations
58         */
59        _RamSize = RamSize;
60        __RamSize = RamSize;
61
62        /*
63         * Boot PROM
64         */
65        rom : {
66                _RomBase = .;
67                __RomBase = .;
68        } >rom
69
70        /*
71         * Dynamic RAM
72         */
73        ram : {
74                _RamBase = .;
75                __RamBase = .;
76        } >ram
77
78        /*
79         * Text, data and bss segments
80         */
81        .text : {
82                CREATE_OBJECT_SYMBOLS
83                *(.text)
84                . = ALIGN (16);
85
86                /*
87                 * C++ constructors
88                 */
89                __CTOR_LIST__ = .;
90                LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
91                *(.ctors)
92                LONG(0)
93                __CTOR_END__ = .;
94                __DTOR_LIST__ = .;
95                LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
96                *(.dtors)
97                LONG(0)
98                __DTOR_END__ = .;
99
100                etext = .;
101                _etext = .;
102        } >rom
103        .data : {
104                copy_start = .;
105                *(.data)
106                . = ALIGN (16);
107                _edata = .;
108                copy_end = .;
109        } >ram
110        .bss : {
111                M68Kvec = .;
112                _M68Kvec = .;
113                . += (256 * 4);
114                clear_start = .;
115                *(.bss)
116                *(COMMON)
117                . = ALIGN (16);
118                _end = .;
119
120                _HeapStart = .;
121                __HeapStart = .;
122                . += HeapSize;  /* XXX -- Old gld can't handle this */
123                . += StackSize; /* XXX -- Old gld can't handle this */
124                /* . += 0x10000; */ /* HeapSize for old gld */
125                /* . += 0x1000;  */ /* StackSize for old gld */
126                . = ALIGN (16);
127                stack_init = .;
128                clear_end = .;
129
130                _WorkspaceBase = .;
131                __WorkspaceBase = .;
132        } >ram
133
134        /*
135         * On-chip memory/peripherals
136         */
137        dpram : {
138                m360 = .;
139                _m360 = .;
140                . += (8 * 1024);
141
142        } >dpram
143}
Note: See TracBrowser for help on using the repository browser.