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