source: rtems/c/src/lib/libbsp/m68k/efi332/startup/linkcmds_ROM @ 50bb7627

4.104.114.84.95
Last change on this file since 50bb7627 was 50bb7627, checked in by Joel Sherrill <joel.sherrill@…>, on Oct 12, 2000 at 12:56:07 PM

2000-10-12 John S Gwynne <jgwynne@…>

  • start/start.c: Modified to support generation of ram_init.
  • start/ram_init.ld, BSP/start/ram_init.sed: New files. These changes enable RTEMS to automatically generate the ram_init file used by gdb with the BDM patches. The 332 has on-board chip select lines (for RAM and FLASH) that must be configured before use of these peripherals. These patches parse data from start.c where the chip select lines are configured in the runtime executable and automatically generates the gdb initialization file using the same settings. A great time saver. A similar file, ram_init_FW (flash writable), is also generated that the flash programming tool uses.
  • start/Makefile.am: Modified to support above.
  • CPU/sim.h: Modified to support above.
  • startup/except_vect_332_ROM.S: Moved to start so it would not be included in libbsp.a. Moving it to start ensures it is available as a single object file.
  • start/except_vect_332_ROM.S: Moved from startup.
  • startup/linkcmds, startup/linkcmds_ROM: Fixes to the memory map shown in the comments.
  • Property mode set to 100644
File size: 5.3 KB
Line 
1/*  linkcmds
2 *
3 *  $Id$
4 */
5
6OUTPUT_ARCH(m68k)
7STARTUP(except_vect_332_ROM.o)
8__DYNAMIC  =  0;
9
10/*
11 * The memory map looks like this:
12 * ROM:
13 * +--------------------+ <- low memory
14 * | .text              |
15 * |        etext       |
16 * |        ctor list   | the ctor and dtor lists are for
17 * |        dtor list   | C++ support
18 * |        _endtext    |
19 * | temporary .data    | .data is moved to RAM by crt0
20 * |                    |
21 * +--------------------+ <- high memory
22 *
23 *
24 * RAM:
25 * +--------------------+ <- low memory
26 * |        _RamBase    |
27 * | .data              | initialized data goes here
28 * |        _sdata      |
29 * |        _edata      |
30 * +--------------------+
31 * | .bss               |
32 * |        _clear_start| start of bss, cleared by crt0
33 * |        _end        | start of heap, used by sbrk()
34 * +--------------------+
35 * |         _WorkspaceBase
36 * |    work space      |
37 * |        heapStart   |
38 * |    heap space      |
39 * |        _RamEnd     | top of stack
40 * +--------------------+ <- high memory
41 */
42
43/*
44 * Declare some sizes.
45 */
46_RamBase = DEFINED(_RamBase) ? _RamBase : 0x80000;
47_RamSize = DEFINED(_RamSize) ? _RamSize : 0x40000;
48_RamEnd = _RamBase + _RamSize;
49_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000;
50_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
51
52MEMORY
53{
54  rom     : ORIGIN = 0x00000, LENGTH = 256K
55  ram     : ORIGIN = 0x80000, LENGTH = 256K
56}
57
58_copy_data_from_rom = 1;
59
60/*
61 *
62 */
63SECTIONS
64{
65        ram : {
66                . = .;
67        } >ram
68
69        /*
70         * Text, data and bss segments
71         */
72        .text : {
73    *(.text)
74
75                /*
76                 * C++ constructors/destructors
77                 */
78                *(.gnu.linkonce.t.*)
79
80                /*
81                 * Initialization and finalization code.
82                 *
83                 * Various files can provide initialization and finalization
84                 * functions.  crtbegin.o and crtend.o are two instances. The
85                 * body of these functions are in .init and .fini sections. We
86                 * accumulate the bodies here, and prepend function prologues
87                 * from crti.o and function epilogues from crtn.o. crti.o must
88                 * be linked first; crtn.o must be linked last.  Because these
89                 * are wildcards, it doesn't matter if the user does not
90                 * actually link against crti.o and crtn.o; the linker won't
91                 * look for a file to match a wildcard.  The wildcard also
92                 * means that it doesn't matter which directory crti.o and
93                 * crtn.o are in.
94                 */
95                PROVIDE (_init = .);
96                *crti.o(.init)
97                *(.init)
98                *crtn.o(.init)
99                PROVIDE (_fini = .);
100                *crti.o(.fini)
101                *(.fini)
102                *crtn.o(.fini)
103
104                /*
105                 * C++ constructors/destructors
106                 *
107                 * gcc uses crtbegin.o to find the start of the constructors
108                 * and destructors so we make sure it is first.  Because this
109                 * is a wildcard, it doesn't matter if the user does not
110                 * actually link against crtbegin.o; the linker won't look for
111                 * a file to match a wildcard.  The wildcard also means that
112                 * it doesn't matter which directory crtbegin.o is in. The
113                 * constructor and destructor list are terminated in
114                 * crtend.o.  The same comments apply to it.
115                 */
116                . = ALIGN (16);
117                *crtbegin.o(.ctors)
118    *(.ctors)
119                *crtend.o(.ctors)
120                *crtbegin.o(.dtors)
121    *(.dtors)
122                *crtend.o(.dtors)
123
124                /*
125                 * Exception frame info
126                 */
127                . = ALIGN (16);
128                *(.eh_frame)
129
130                /*
131                 * Read-only data
132                 */
133                . = ALIGN (16);
134                _rodata_start = . ;
135                *(.rodata)
136                *(.gnu.linkonce.r*)
137
138                 . = ALIGN (16);
139                PROVIDE (_etext = .);
140        } >rom
141  .data :
142        AT ( ADDR(.text) + SIZEOF( .text ) )
143  {
144                PROVIDE (_copy_start = .);
145    *(.data)
146                *(.gnu.linkonce.d*)
147                *(.gcc_except_table)
148                . = ALIGN (16);
149                PROVIDE (_edata = .);
150                PROVIDE (_copy_end = .);
151        } >ram
152        .bss : {
153                _clear_start = .;
154    *(.bss)
155    *(COMMON)
156                . = ALIGN (16);
157                PROVIDE (end = .);
158
159                . += _StackSize;
160                . = ALIGN (16);
161                _stack_init = .;
162                _clear_end = .;
163
164                _WorkspaceBase = .;
165        } >ram
166
167  /* Stabs debugging sections.  */
168  .stab 0 : { *(.stab) }
169  .stabstr 0 : { *(.stabstr) }
170  .stab.excl 0 : { *(.stab.excl) }
171  .stab.exclstr 0 : { *(.stab.exclstr) }
172  .stab.index 0 : { *(.stab.index) }
173  .stab.indexstr 0 : { *(.stab.indexstr) }
174  .comment 0 : { *(.comment) }
175
176  /* DWARF debug sections.
177     Symbols in the DWARF debugging sections are relative to the beginning
178     of the section so we begin them at 0.  */
179  /* DWARF 1 */
180  .debug          0 : { *(.debug) }
181  .line           0 : { *(.line) }
182 
183  /* GNU DWARF 1 extensions */
184  .debug_srcinfo  0 : { *(.debug_srcinfo) }
185  .debug_sfnames  0 : { *(.debug_sfnames) }
186 
187  /* DWARF 1.1 and DWARF 2 */
188  .debug_aranges  0 : { *(.debug_aranges) }
189  .debug_pubnames 0 : { *(.debug_pubnames) }
190 
191  /* DWARF 2 */
192  .debug_info     0 : { *(.debug_info) }
193  .debug_abbrev   0 : { *(.debug_abbrev) }
194  .debug_line     0 : { *(.debug_line) }
195  .debug_frame    0 : { *(.debug_frame) }
196  .debug_str      0 : { *(.debug_str) }
197  .debug_loc      0 : { *(.debug_loc) }
198  .debug_macinfo  0 : { *(.debug_macinfo) }
199 
200  /* SGI/MIPS DWARF 2 extensions */
201  .debug_weaknames 0 : { *(.debug_weaknames) }
202  .debug_funcnames 0 : { *(.debug_funcnames) }
203  .debug_typenames 0 : { *(.debug_typenames) }
204  .debug_varnames  0 : { *(.debug_varnames) }
205  /* These must appear regardless of  .  */
206}
Note: See TracBrowser for help on using the repository browser.