source: rtems/c/src/lib/libbsp/m68k/efi68k/startup/linkcmds @ b2b4835

4.104.114.84.95
Last change on this file since b2b4835 was b2b4835, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 12, 2000 at 4:38:57 PM

Eric Norum <eric@…> submitted linker script and bsp_specs
for the gen68360 that let it work with ELF and C++ exceptions. This
was used as the basis for changes to EVERY m68k bsp_specs and linkcmds.
Before this modification is over, the layout of the starting stack,
heap, and workspace will likely be modified for every m68k BSP. Then
they will all be very similar.

  • 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 * |        __bss_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/*
35 * User modifiable values:
36 *
37 * _VBR                 location of VBR table
38 */
39
40MEMORY
41{
42  ram     : ORIGIN = 0x203000, LENGTH = 256K
43}
44
45_VBR = 0x200000;                /* location of the VBR table (in RAM) */
46__end_of_ram = 0x240000;
47_copy_data_from_rom = 0;
48
49/*
50 * Declare some sizes.
51 */
52HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
53StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
54
55/*
56 * stick everything in ram (of course)
57 */
58
59SECTIONS
60{
61        ram : {
62                . = .;
63        } >ram
64
65        /*
66         * Text, data and bss segments
67         */
68        .text : {
69                *(.text)
70
71                /*
72                 * C++ constructors/destructors
73                 */
74                *(.gnu.linkonce.t.*)
75
76                /*
77                 * Initialization and finalization code.
78                 *
79                 * Various files can provide initialization and finalization
80                 * functions.  crtbegin.o and crtend.o are two instances. The
81                 * body of these functions are in .init and .fini sections. We
82                 * accumulate the bodies here, and prepend function prologues
83                 * from crti.o and function epilogues from crtn.o. crti.o must
84                 * be linked first; crtn.o must be linked last.  Because these
85                 * are wildcards, it doesn't matter if the user does not
86                 * actually link against crti.o and crtn.o; the linker won't
87                 * look for a file to match a wildcard.  The wildcard also
88                 * means that it doesn't matter which directory crti.o and
89                 * crtn.o are in.
90                 */
91                PROVIDE (_init = .);
92                *crti.o(.init)
93                *(.init)
94                *crtn.o(.init)
95                PROVIDE (_fini = .);
96                *crti.o(.fini)
97                *(.fini)
98                *crtn.o(.fini)
99
100                /*
101                 * C++ constructors/destructors
102                 *
103                 * gcc uses crtbegin.o to find the start of the constructors
104                 * and destructors so we make sure it is first.  Because this
105                 * is a wildcard, it doesn't matter if the user does not
106                 * actually link against crtbegin.o; the linker won't look for
107                 * a file to match a wildcard.  The wildcard also means that
108                 * it doesn't matter which directory crtbegin.o is in. The
109                 * constructor and destructor list are terminated in
110                 * crtend.o.  The same comments apply to it.
111                 */
112                . = ALIGN (16);
113                *crtbegin.o(.ctors)
114                *(.ctors)
115                *crtend.o(.ctors)
116                *crtbegin.o(.dtors)
117                *(.dtors)
118                *crtend.o(.dtors)
119
120                /*
121                 * Exception frame info
122                 */
123                . = ALIGN (16);
124                *(.eh_frame)
125
126                /*
127                 * Read-only data
128                 */
129                . = ALIGN (16);
130                _rodata_start = . ;
131                *(.rodata)
132                *(.gnu.linkonce.r*)
133
134                 . = ALIGN (16);
135                PROVIDE (_etext = .);
136        } >ram
137        .data : {
138                PROVIDE (_copy_start = .);
139                *(.data)
140                *(.gnu.linkonce.d*)
141                *(.gcc_except_table)
142                . = ALIGN (16);
143                PROVIDE (_edata = .);
144                PROVIDE (_copy_end = .);
145        } >ram
146        .bss : {
147                PROVIDE (_bss_start = .);
148                PROVIDE (_clear_start = .);
149                *(.bss)
150                *(COMMON)
151                . = ALIGN (16);
152                PROVIDE (end = .);
153
154                . += StackSize;
155                PROVIDE (_stack_init = .);
156
157                . = ALIGN (16);
158                PROVIDE (_HeapStart = .);
159                . += HeapSize;
160                PROVIDE (_HeapEnd = .);
161
162                clear_end = .;
163
164                PROVIDE (_WorkspaceBase = .);
165        } >ram
166}
Note: See TracBrowser for help on using the repository browser.