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