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