source: rtems/c/src/lib/libbsp/m68k/gen68302/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.4 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the Generic MC68302 board.
4 *
5 *  COPYRIGHT (c) 1989-1999.
6 *  On-Line Applications Research Corporation (OAR).
7 *
8 *  The license and distribution terms for this file may be
9 *  found in the file LICENSE in this distribution or at
10 *  http://www.OARcorp.com/rtems/license.html.
11 *
12 *  $Id$
13 */
14
15MEMORY
16{
17        ram : org = 0x0000, l = 16M
18}
19
20m302 = 0xf7f000;
21_VBR = 0x000000;                /* location of the VBR table (in RAM) */
22
23/*
24 * Declare some sizes.
25 */
26HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000;
27StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
28
29SECTIONS
30{
31        ram : {
32                . = 0xc00000;
33        } >ram
34
35        /*
36         * Text, data and bss segments
37         */
38        .text : {
39                *(.text)
40
41                /*
42                 * C++ constructors/destructors
43                 */
44                *(.gnu.linkonce.t.*)
45
46                /*
47                 * Initialization and finalization code.
48                 *
49                 * Various files can provide initialization and finalization
50                 * functions.  crtbegin.o and crtend.o are two instances. The
51                 * body of these functions are in .init and .fini sections. We
52                 * accumulate the bodies here, and prepend function prologues
53                 * from crti.o and function epilogues from crtn.o. crti.o must
54                 * be linked first; crtn.o must be linked last.  Because these
55                 * are wildcards, it doesn't matter if the user does not
56                 * actually link against crti.o and crtn.o; the linker won't
57                 * look for a file to match a wildcard.  The wildcard also
58                 * means that it doesn't matter which directory crti.o and
59                 * crtn.o are in.
60                 */
61                PROVIDE (_init = .);
62                *crti.o(.init)
63                *(.init)
64                *crtn.o(.init)
65                PROVIDE (_fini = .);
66                *crti.o(.fini)
67                *(.fini)
68                *crtn.o(.fini)
69
70                /*
71                 * C++ constructors/destructors
72                 *
73                 * gcc uses crtbegin.o to find the start of the constructors
74                 * and destructors so we make sure it is first.  Because this
75                 * is a wildcard, it doesn't matter if the user does not
76                 * actually link against crtbegin.o; the linker won't look for
77                 * a file to match a wildcard.  The wildcard also means that
78                 * it doesn't matter which directory crtbegin.o is in. The
79                 * constructor and destructor list are terminated in
80                 * crtend.o.  The same comments apply to it.
81                 */
82                . = ALIGN (16);
83                *crtbegin.o(.ctors)
84                *(.ctors)
85                *crtend.o(.ctors)
86                *crtbegin.o(.dtors)
87                *(.dtors)
88                *crtend.o(.dtors)
89
90                /*
91                 * Exception frame info
92                 */
93                . = ALIGN (16);
94                *(.eh_frame)
95
96                /*
97                 * Read-only data
98                 */
99                . = ALIGN (16);
100                _rodata_start = . ;
101                *(.rodata)
102                *(.gnu.linkonce.r*)
103
104                 . = ALIGN (16);
105                PROVIDE (_etext = .);
106        } >ram
107        .data : {
108                PROVIDE (_copy_start = .);
109                *(.data)
110                *(.gnu.linkonce.d*)
111                *(.gcc_except_table)
112                . = ALIGN (16);
113                PROVIDE (_edata = .);
114                PROVIDE (_copy_end = .);
115        } >ram
116        .bss : {
117                PROVIDE (_bss_start = .);
118                PROVIDE (_clear_start = .);
119                *(.bss)
120                *(COMMON)
121                . = ALIGN (16);
122                PROVIDE (end = .);
123
124                . += StackSize;
125                PROVIDE (_stack_init = .);
126
127                . = ALIGN (16);
128                PROVIDE (_HeapStart = .);
129                . += HeapSize;
130                PROVIDE (_HeapEnd = .);
131
132                clear_end = .;
133
134                PROVIDE (_WorkspaceBase = .);
135        } >ram
136}
Note: See TracBrowser for help on using the repository browser.