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

4.104.114.84.95
Last change on this file since bebf0438 was 9f30a08b, checked in by Joel Sherrill <joel.sherrill@…>, on 09/29/00 at 14:25:46

2000-09-29 Charles-Antoine Gauthier <charles.gauthier@…>

  • startup/linkcmds: Added lines so DWARF debug information would be available. Otherwise gdb complains that the offsets for the debug info are incorrect and doesn't load the files.
  • Property mode set to 100644
File size: 5.2 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/*
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 */
52_RamBase = DEFINED(_RamBase) ? _RamBase : 0x200000;
53_RamSize = DEFINED(_RamSize) ? _RamSize : 256K;
54_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
55_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
56
57/*
58 * stick everything in ram (of course)
59 */
60
61SECTIONS
62{
63        ram : {
64                . = .;
65        } >ram
66
67        /*
68         * Text, data and bss segments
69         */
70        .text : {
71                *(.text)
72
73                /*
74                 * C++ constructors/destructors
75                 */
76                *(.gnu.linkonce.t.*)
77
78                /*
79                 * Initialization and finalization code.
80                 *
81                 * Various files can provide initialization and finalization
82                 * functions.  crtbegin.o and crtend.o are two instances. The
83                 * body of these functions are in .init and .fini sections. We
84                 * accumulate the bodies here, and prepend function prologues
85                 * from crti.o and function epilogues from crtn.o. crti.o must
86                 * be linked first; crtn.o must be linked last.  Because these
87                 * are wildcards, it doesn't matter if the user does not
88                 * actually link against crti.o and crtn.o; the linker won't
89                 * look for a file to match a wildcard.  The wildcard also
90                 * means that it doesn't matter which directory crti.o and
91                 * crtn.o are in.
92                 */
93                PROVIDE (_init = .);
94                *crti.o(.init)
95                *(.init)
96                *crtn.o(.init)
97                PROVIDE (_fini = .);
98                *crti.o(.fini)
99                *(.fini)
100                *crtn.o(.fini)
101
102                /*
103                 * C++ constructors/destructors
104                 *
105                 * gcc uses crtbegin.o to find the start of the constructors
106                 * and destructors so we make sure it is first.  Because this
107                 * is a wildcard, it doesn't matter if the user does not
108                 * actually link against crtbegin.o; the linker won't look for
109                 * a file to match a wildcard.  The wildcard also means that
110                 * it doesn't matter which directory crtbegin.o is in. The
111                 * constructor and destructor list are terminated in
112                 * crtend.o.  The same comments apply to it.
113                 */
114                . = ALIGN (16);
115                *crtbegin.o(.ctors)
116                *(.ctors)
117                *crtend.o(.ctors)
118                *crtbegin.o(.dtors)
119                *(.dtors)
120                *crtend.o(.dtors)
121
122                /*
123                 * Exception frame info
124                 */
125                . = ALIGN (16);
126                *(.eh_frame)
127
128                /*
129                 * Read-only data
130                 */
131                . = ALIGN (16);
132                _rodata_start = . ;
133                *(.rodata)
134                *(.gnu.linkonce.r*)
135
136                 . = ALIGN (16);
137                PROVIDE (_etext = .);
138        } >ram
139        .data : {
140                PROVIDE (_copy_start = .);
141                *(.data)
142                *(.gnu.linkonce.d*)
143                *(.gcc_except_table)
144                . = ALIGN (16);
145                PROVIDE (_edata = .);
146                PROVIDE (_copy_end = .);
147        } >ram
148        .bss : {
149                _clear_start = .;
150                *(.bss)
151                *(COMMON)
152                . = ALIGN (16);
153                PROVIDE (end = .);
154
155                . += _StackSize;
156                . = ALIGN (16);
157                _stack_init = .;
158                _clear_end = .;
159
160                _WorkspaceBase = .;
161        } >ram
162
163  /* Stabs debugging sections.  */
164  .stab 0 : { *(.stab) }
165  .stabstr 0 : { *(.stabstr) }
166  .stab.excl 0 : { *(.stab.excl) }
167  .stab.exclstr 0 : { *(.stab.exclstr) }
168  .stab.index 0 : { *(.stab.index) }
169  .stab.indexstr 0 : { *(.stab.indexstr) }
170  .comment 0 : { *(.comment) }
171
172  /* DWARF debug sections.
173     Symbols in the DWARF debugging sections are relative to the beginning
174     of the section so we begin them at 0.  */
175  /* DWARF 1 */
176  .debug          0 : { *(.debug) }
177  .line           0 : { *(.line) }
178 
179  /* GNU DWARF 1 extensions */
180  .debug_srcinfo  0 : { *(.debug_srcinfo) }
181  .debug_sfnames  0 : { *(.debug_sfnames) }
182 
183  /* DWARF 1.1 and DWARF 2 */
184  .debug_aranges  0 : { *(.debug_aranges) }
185  .debug_pubnames 0 : { *(.debug_pubnames) }
186 
187  /* DWARF 2 */
188  .debug_info     0 : { *(.debug_info) }
189  .debug_abbrev   0 : { *(.debug_abbrev) }
190  .debug_line     0 : { *(.debug_line) }
191  .debug_frame    0 : { *(.debug_frame) }
192  .debug_str      0 : { *(.debug_str) }
193  .debug_loc      0 : { *(.debug_loc) }
194  .debug_macinfo  0 : { *(.debug_macinfo) }
195 
196  /* SGI/MIPS DWARF 2 extensions */
197  .debug_weaknames 0 : { *(.debug_weaknames) }
198  .debug_funcnames 0 : { *(.debug_funcnames) }
199  .debug_typenames 0 : { *(.debug_typenames) }
200  .debug_varnames  0 : { *(.debug_varnames) }
201  /* These must appear regardless of  .  */
202}
Note: See TracBrowser for help on using the repository browser.