source: rtems/c/src/lib/libbsp/mips/malta/startup/linkcmds @ 3167e67

5
Last change on this file since 3167e67 was 3167e67, checked in by Joel Sherrill <joel@…>, on 12/18/17 at 22:53:10

malta: Simplify bsp_specs

Updates #3250.

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