source: rtems/c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom @ 0af1b73f

4.104.114.84.95
Last change on this file since 0af1b73f was 0af1b73f, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 3, 2000 at 5:27:06 PM

Patch from Eric Norum <eric@…>:

In another attempt to get C++ exceptions working on the gen68360 target
I tried building for the m68k-elf target. All the tools built and
installed properly as did all of RTEMS. No applications would run,
though -- not even hello.exe!

It turns out the problem was in the linker script. The alignment was in
the wrong place.

Here's a patch. Exceptions still don't work, but at least I can get
some things working with the ELF format now.

  • Property mode set to 100644
File size: 3.1 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 */
24HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
25StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
26
27/*
28 * Declare on-board memory.
29 */
30MEMORY {
31          ram : ORIGIN = 0x00000000, LENGTH = 64M
32          rom : ORIGIN = 0x0F000000, LENGTH = 1M
33        dpram : ORIGIN = 0x0E000000, LENGTH = 8k
34}
35
36/*
37 * Load objects
38 */
39SECTIONS {
40        /*
41         * Boot PROM
42         */
43        rom : {
44                _RomBase = .;
45                __RomBase = .;
46        } >rom
47
48        /*
49         * Dynamic RAM
50         */
51        ram : {
52                _RamBase = .;
53                __RamBase = .;
54        } >ram
55
56        /*
57         * Text, data and bss segments
58         */
59        .text : AT (0x00000000) {
60                CREATE_OBJECT_SYMBOLS
61                *(.text)
62                . = ALIGN (16);
63
64                *(.eh_fram)
65                . = ALIGN (16);
66
67                /*
68                 * C++ constructors
69                 */
70                __CTOR_LIST__ = .;
71                LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2)
72                *(.ctors)
73                LONG(0)
74                __CTOR_END__ = .;
75                __DTOR_LIST__ = .;
76                LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2)
77                *(.dtors)
78                LONG(0)
79                __DTOR_END__ = .;
80
81                . = ALIGN (16);
82
83                etext = .;
84                _etext = .;
85        } >rom
86        .data : AT(SIZEOF(.text)) {
87                copy_start = .;
88                *(.data)
89                . = ALIGN (16);
90                _edata = .;
91                copy_end = .;
92        } >ram
93        .bss : {
94                M68Kvec = .;
95                _M68Kvec = .;
96                . += (256 * 4);
97                clear_start = .;
98                *(.bss)
99                *(COMMON)
100                . = ALIGN (16);
101                _end = .;
102
103                _HeapStart = .;
104                __HeapStart = .;
105                . += HeapSize;  /* XXX -- Old gld can't handle this */
106                . += StackSize; /* XXX -- Old gld can't handle this */
107                /* . += 0x10000; */ /* HeapSize for old gld */
108                /* . += 0x1000;  */ /* StackSize for old gld */
109                . = ALIGN (16);
110                stack_init = .;
111                clear_end = .;
112
113                _WorkspaceBase = .;
114                __WorkspaceBase = .;
115        } >ram
116
117        /*
118         * On-chip memory/peripherals
119         */
120        dpram : {
121                m360 = .;
122                _m360 = .;
123                . += (8 * 1024);
124
125        } >dpram
126}
Note: See TracBrowser for help on using the repository browser.