source: rtems/c/src/lib/libbsp/m68k/mrm332/startup/linkcmds @ c0c6168

4.104.114.84.95
Last change on this file since c0c6168 was c0c6168, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 20, 2003 at 8:33:17 PM

2003-01-20 Duane Gustavus <duane@…>

  • console/sci.c, include/mrm332.h, startup/linkcmds, startup/linkcmds_ROM: Various updates to make this run properly from ROM.
  • Property mode set to 100644
File size: 3.9 KB
Line 
1/*  linkcmds
2 *
3 *  $Id$
4 */
5
6OUTPUT_ARCH(m68k)
7__DYNAMIC  =  0;
8
9/*
10 * The memory map looks like this:
11 * +--------------------+ <- low memory
12 * | .text              |
13 * |        etext       |
14 * |        ctor list   | the ctor and dtor lists are for
15 * |        dtor list   | C++ support
16 * |        _endtext    |
17 * +--------------------+
18 * | .data              | initialized data goes here
19 * |        _sdata      |
20 * |        _edata      |
21 * +--------------------+
22 * | .bss               |
23 * |        _clear_start| start of bss, cleared by crt0
24 * |        _end        | start of heap, used by sbrk()
25 * +--------------------+
26 * |    heap space      |
27 * |        _ENDHEAP    |
28 * |    stack space     |
29 * |        __stack     | top of stack
30 * +--------------------+ <- high memory
31 */
32
33/*
34 * Declare some sizes.
35 */
36_RamBase = DEFINED(_RamBase) ? _RamBase : 0x10000;
37_RamSize = DEFINED(_RamSize) ? _RamSize : 0x70000;
38_RamEnd = _RamBase + _RamSize;
39_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
40_StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
41
42MEMORY
43{
44  ram     : ORIGIN = 0x10000, LENGTH = 0x70000
45}
46
47_copy_data_from_rom = 0;
48
49/*
50 * stick everything in ram (of course)
51 */
52SECTIONS
53{
54        ram : {
55                . = .;
56        } >ram
57
58        /*
59         * Text, data and bss segments
60         */
61        .text : {
62                *(.text)
63
64                /*
65                 * C++ constructors/destructors
66                 */
67                *(.gnu.linkonce.t.*)
68
69                /*
70                 * Initialization and finalization code.
71                 *
72                 * Various files can provide initialization and finalization
73                 * functions.  crtbegin.o and crtend.o are two instances. The
74                 * body of these functions are in .init and .fini sections. We
75                 * accumulate the bodies here, and prepend function prologues
76                 * from crti.o and function epilogues from crtn.o. crti.o must
77                 * be linked first; crtn.o must be linked last.  Because these
78                 * are wildcards, it doesn't matter if the user does not
79                 * actually link against crti.o and crtn.o; the linker won't
80                 * look for a file to match a wildcard.  The wildcard also
81                 * means that it doesn't matter which directory crti.o and
82                 * crtn.o are in.
83                 */
84                PROVIDE (_init = .);
85                *crti.o(.init)
86                *(.init)
87                *crtn.o(.init)
88                PROVIDE (_fini = .);
89                *crti.o(.fini)
90                *(.fini)
91                *crtn.o(.fini)
92
93                /*
94                 * Special FreeBSD sysctl sections.
95                 */
96                . = ALIGN (16);
97                __start_set_sysctl_set = .;
98                *(set_sysctl_*);
99                __stop_set_sysctl_set = ABSOLUTE(.);
100                *(set_domain_*);
101                *(set_pseudo_*);
102
103                /*
104                 * C++ constructors/destructors
105                 *
106                 * gcc uses crtbegin.o to find the start of the constructors
107                 * and destructors so we make sure it is first.  Because this
108                 * is a wildcard, it doesn't matter if the user does not
109                 * actually link against crtbegin.o; the linker won't look for
110                 * a file to match a wildcard.  The wildcard also means that
111                 * it doesn't matter which directory crtbegin.o is in. The
112                 * constructor and destructor list are terminated in
113                 * crtend.o.  The same comments apply to it.
114                 */
115                . = ALIGN (16);
116                *crtbegin.o(.ctors)
117                *(.ctors)
118                *crtend.o(.ctors)
119                *crtbegin.o(.dtors)
120                *(.dtors)
121                *crtend.o(.dtors)
122
123                /*
124                 * Exception frame info
125                 */
126                . = ALIGN (16);
127                *(.eh_frame)
128
129                /*
130                 * Read-only data
131                 */
132                . = ALIGN (16);
133                _rodata_start = .;
134                *(.rodata*)
135                *(.gnu.linkonce.r*)
136
137                 . = ALIGN (16);
138                PROVIDE (_etext = .);
139        } >ram
140        .data : {
141                PROVIDE (_copy_start = .);
142                *(.data)
143                *(.gnu.linkonce.d*)
144                *(.gcc_except_table)
145                *(.jcr)
146                . = ALIGN (16);
147                PROVIDE (_edata = .);
148                PROVIDE (_copy_end = .);
149        } >ram
150        .bss : {
151                _clear_start = .;
152                *(.bss)
153                *(COMMON)
154                . = ALIGN (16);
155                PROVIDE (end = .);
156                . += _StackSize;
157                . = ALIGN (16);
158                _stack_init = .;
159                _clear_end = .;
160
161                _WorkspaceBase = .;
162        } >ram
163}
Note: See TracBrowser for help on using the repository browser.