source: rtems/c/src/lib/libbsp/mips/genmongoosev/startup/linkcmds @ b618d8c

5
Last change on this file since b618d8c was b618d8c, checked in by Sebastian Huber <sebastian.huber@…>, on 09/16/15 at 05:13:58

Add RTEMS linker sets

Update #2408.

  • Property mode set to 100644
File size: 4.6 KB
Line 
1/*
2 *  Linker script for Mongoose-V prototyping board.
3 *  See README for address map details.
4 */
5
6/*    . = 0x80020000; */
7
8/*
9 * Declare some sizes.
10 */
11
12RamBase = DEFINED(RamBase) ? RamBase : 0x80000000;
13RamSize = DEFINED(RamSize) ? RamSize : 32M;
14HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
15_StackSize = DEFINED(_StackSize) ? _StackSize : 0x4000;
16ClockRate = DEFINED(ClockRate) ? ClockRate : 12000000;
17
18MEMORY
19{
20   ram      : ORIGIN = 0x80020000, LENGTH = 4M
21}
22
23SECTIONS
24{
25    .text :
26    {
27       _ftext = . ;
28
29      */start.o(.text)
30
31      *(.text*)
32      *(.gnu.linkonce.t*)
33      *(.mips16.fn.*)
34      *(.mips16.call.*)
35      *(.reginfo)
36      PROVIDE (__runtime_reloc_start = .);
37      *(.rel.sdata)
38      *(.rel.dyn)
39      PROVIDE (__runtime_reloc_stop = .);
40
41      /*
42       * Special FreeBSD sysctl sections.
43       */
44      . = ALIGN (16);
45      __start_set_sysctl_set = .;
46      *(set_sysctl_*);
47      __stop_set_sysctl_set = ABSOLUTE(.);
48      *(set_domain_*);
49      *(set_pseudo_*);
50
51      *(.gcc_except_table*)
52      *(.eh_frame_hdr)
53      *(.eh_frame)
54    } >ram 
55
56  .init :
57  {
58     KEEP(*(.init))
59
60  } > ram
61
62  .fini :
63  {
64     KEEP(*(.fini))
65
66  }  > ram
67
68
69  .ctors    :
70  {
71    /* gcc uses crtbegin.o to find the start of
72       the constructors, so we make sure it is
73       first.  Because this is a wildcard, it
74       doesn't matter if the user does not
75       actually link against crtbegin.o; the
76       linker won't look for a file to match a
77       wildcard.  The wildcard also means that it
78       doesn't matter which directory crtbegin.o
79       is in.  */
80
81    KEEP (*crtbegin.o(.ctors))
82
83    /* We don't want to include the .ctor section from
84       from the crtend.o file until after the sorted ctors.
85       The .ctor section from the crtend file contains the
86       end of ctors marker and it must be last */
87
88    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
89    KEEP (*(SORT(.ctors.*)))
90    KEEP (*(.ctors))
91  } >ram 
92
93  .dtors    :
94  {
95    KEEP (*crtbegin.o(.dtors))
96    KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
97    KEEP (*(SORT(.dtors.*)))
98    KEEP (*(.dtors))
99
100    etext  =  .;
101    _etext  =  .;
102  } >ram 
103
104
105
106  .rdata :
107  {
108    *(.rdata)
109    *(.rodata)
110    *(.rodata.*)
111    KEEP (*(SORT(.rtemsroset.*)))
112    *(.gnu.linkonce.r*)
113  } >ram 
114
115  .tdata : {
116    _TLS_Data_begin = .;
117    *(.tdata .tdata.* .gnu.linkonce.td.*)
118    _TLS_Data_end = .;
119  } >ram
120
121  .tbss : {
122    _TLS_BSS_begin = .;
123    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
124    _TLS_BSS_end = .;
125  } >ram
126
127  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
128  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
129  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
130  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
131  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
132  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
133
134  .data :
135  {
136    _fdata = ALIGN(16);
137
138    *(.data)
139    *(.data.*)
140    KEEP (*(SORT(.rtemsrwset.*)))
141    *(.gnu.linkonce.d*)
142  } >ram 
143
144  .jcr :
145  {
146    . = ALIGN(8);
147    KEEP (*(.jcr))
148
149    _gp = ALIGN(16) + 0x7440;
150    __global = _gp;
151  } >ram
152
153  .lit8 :
154  {
155    *(.lit8)
156  } >ram 
157
158  .lit4 :
159  {
160    *(.lit4)
161  } >ram   
162
163  .sdata :   
164  {
165    *(.sdata*)
166    *(.gnu.linkonce.s*)
167  } >ram 
168
169  .sbss :
170  {
171   edata  =  .;
172   _edata  =  .;
173   _fbss = .;
174    *(.sbss*)
175    *(.scommon)
176  } >ram   
177
178
179  .bss :
180  {
181    _bss_start = . ;
182    *(.bss .bss.* .gnu.linkonce.b.*)
183    *(COMMON)
184    . = ALIGN (64);
185    _stack_limit = .;
186    . += _StackSize;
187    __stack = .;
188    _stack_init = .;
189    _clear_end = .;
190    WorkAreaBase = .;
191    end = .;
192    _end = .;
193  } >ram   
194
195
196/*
197** DWARF debug sections.
198** Symbols in the DWARF debugging sections are relative to
199** the beginning of the section so we begin them at 0. 
200*/
201
202  /* DWARF 1 */
203  .debug          0 : { *(.debug) }
204  .line           0 : { *(.line) }
205
206  /* GNU DWARF 1 extensions */
207  .debug_srcinfo  0 : { *(.debug_srcinfo) }
208  .debug_sfnames  0 : { *(.debug_sfnames) }
209
210  /* DWARF 1.1 and DWARF 2 */
211  .debug_aranges  0 : { *(.debug_aranges) }
212  .debug_pubnames 0 : { *(.debug_pubnames) }
213
214  /* DWARF 2 */
215  .debug_info     0 : { *(.debug_info) }   
216  .debug_abbrev   0 : { *(.debug_abbrev) } 
217  .debug_line     0 : { *(.debug_line) }   
218  .debug_frame    0 : { *(.debug_frame)}   
219  .debug_str      0 : { *(.debug_str) }     
220  .debug_loc      0 : { *(.debug_loc) }     
221  .debug_macinfo  0 : { *(.debug_macinfo) }
222
223  /* SGI/MIPS DWARF 2 extensions */
224  .debug_weaknames 0 : { *(.debug_weaknames) }
225  .debug_funcnames 0 : { *(.debug_funcnames) }
226  .debug_typenames 0 : { *(.debug_typenames) }
227  .debug_varnames  0 : { *(.debug_varnames) } 
228}
Note: See TracBrowser for help on using the repository browser.