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

4.104.114.84.95
Last change on this file since 85c92574 was 85c92574, checked in by Joel Sherrill <joel.sherrill@…>, on May 9, 2002 at 9:37:30 PM

2001-05-09 Joel Sherrill <joel@…>

  • startup/linkcmds: In support of gcc 3.1, added one of more of the sections .jcr, .rodata*, .data.*, .gnu.linkonce.s2.*, .gnu.linkonce.sb2.*, and .gnu.linkonce.s.*. Spacing corrections and direction of segments to memory regions may also have been addressed. This was a sweep across all BSPs.
  • Property mode set to 100644
File size: 3.7 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 : 0x03000;
37_RamSize = DEFINED(_RamSize) ? _RamSize : 0x7d000;
38_RamEnd = _RamBase + _RamSize;
39_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
40_StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
41
42MEMORY
43{
44  ram     : ORIGIN = 0x03000, LENGTH = 0x7d000
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                 * C++ constructors/destructors
95                 *
96                 * gcc uses crtbegin.o to find the start of the constructors
97                 * and destructors so we make sure it is first.  Because this
98                 * is a wildcard, it doesn't matter if the user does not
99                 * actually link against crtbegin.o; the linker won't look for
100                 * a file to match a wildcard.  The wildcard also means that
101                 * it doesn't matter which directory crtbegin.o is in. The
102                 * constructor and destructor list are terminated in
103                 * crtend.o.  The same comments apply to it.
104                 */
105                . = ALIGN (16);
106                *crtbegin.o(.ctors)
107                *(.ctors)
108                *crtend.o(.ctors)
109                *crtbegin.o(.dtors)
110                *(.dtors)
111                *crtend.o(.dtors)
112
113                /*
114                 * Exception frame info
115                 */
116                . = ALIGN (16);
117                *(.eh_frame)
118
119                /*
120                 * Read-only data
121                 */
122                . = ALIGN (16);
123                _rodata_start = .;
124                *(.rodata*)
125                *(.gnu.linkonce.r*)
126
127                 . = ALIGN (16);
128                PROVIDE (_etext = .);
129        } >ram
130        .data : {
131                PROVIDE (_copy_start = .);
132                *(.data)
133                *(.gnu.linkonce.d*)
134                *(.gcc_except_table)
135                *(.jcr)
136                . = ALIGN (16);
137                PROVIDE (_edata = .);
138                PROVIDE (_copy_end = .);
139        } >ram
140        .bss : {
141                _clear_start = .;
142                *(.bss)
143                *(COMMON)
144                . = ALIGN (16);
145                PROVIDE (end = .);
146
147                . += _StackSize;
148                . = ALIGN (16);
149                _stack_init = .;
150                _clear_end = .;
151
152                _WorkspaceBase = .;
153        } >ram
154}
Note: See TracBrowser for help on using the repository browser.