source: rtems/bsps/mips/jmr3904/start/linkcmds @ 715d616

5
Last change on this file since 715d616 was 715d616, checked in by Sebastian Huber <sebastian.huber@…>, on 06/19/18 at 13:10:36

bsps: Support .rtemsstack.* linker input sections

Use a dedicated memory region or place it between the BSS and workspace.

Update #3459.

  • Property mode set to 100644
File size: 4.6 KB
Line 
1/*
2 *  Based on jmr3904app-dram.ld from newlib 1.8.2
3 */
4
5/*
6 * Declare some sizes.
7 */
8RamBase = DEFINED(RamBase) ? RamBase : 0x88000000;
9RamSize = DEFINED(RamSize) ? RamSize : 4M;
10HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
11_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
12
13ENTRY(_start)
14STARTUP(start.o)
15
16SECTIONS
17{
18    . = 0x88000000;
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  .rtemsroset : {
37    /* for pre rtems-libbsd FreeBSD code */
38    __start_set_sysctl_set = .;
39    *(set_sysctl_*);
40    __stop_set_sysctl_set = .;
41    *(set_domain_*);
42    *(set_pseudo_*);
43
44    KEEP (*(SORT(.rtemsroset.*)))
45
46    . = ALIGN (16);
47    _endtext = .;
48  }
49
50  .init :
51  {
52        KEEP(*(.init))
53  }
54
55  .fini :
56  {
57        KEEP(*(.fini))
58  }
59
60  .ctors    :
61  {
62    /* gcc uses crtbegin.o to find the start of
63       the constructors, so we make sure it is
64       first.  Because this is a wildcard, it
65       doesn't matter if the user does not
66       actually link against crtbegin.o; the
67       linker won't look for a file to match a
68       wildcard.  The wildcard also means that it
69       doesn't matter which directory crtbegin.o
70       is in.  */
71
72    KEEP (*crtbegin.o(.ctors))
73
74    /* We don't want to include the .ctor section from
75       from the crtend.o file until after the sorted ctors.
76       The .ctor section from the crtend file contains the
77       end of ctors marker and it must be last */
78
79    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
80    KEEP (*(SORT(.ctors.*)))
81    KEEP (*(.ctors))
82  }
83
84  .dtors    :
85  {
86    KEEP (*crtbegin.o(.dtors))
87    KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
88    KEEP (*(SORT(.dtors.*)))
89    KEEP (*(.dtors))
90
91    etext  =  .;
92    _etext  =  .;
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  . = ALIGN(8);
134
135  .jcr : {
136        KEEP (*(.jcr))
137  }
138
139  _gp = ALIGN(16) + 0x7440;
140  __global = _gp;
141
142  .sdata : {
143    *(.sdata)
144    *(.sdata.*)
145    *(.gnu.linkonce.s*)
146  }
147  .lit8 : {
148    *(.lit8)
149  }
150  .lit4 : {
151    *(.lit4)
152  }
153
154   edata  =  .;
155   _edata  =  .;
156   _fbss = .;
157
158  .sbss : {
159    *(.sbss*)
160    *(.scommon)
161  }
162  .bss : {
163    _bss_start = . ;
164    *(.bss*)
165    *(COMMON)
166    . = ALIGN (64);
167    _stack_limit = .;
168    . += _StackSize;
169    __stack = .;
170    _stack_init = .;
171    _clear_end = .;
172  }
173
174  .rtemsstack (NOLOAD) : {
175    *(SORT(.rtemsstack.*))
176    WorkAreaBase = .;
177  }
178
179  . = 0x88400000; /* reserve some memory for Work Area */
180 end = .;
181 _end = .;
182
183
184/* Put starting stack in SRAM (8 Kb); this size is the same as the stack from
185      the original script (when everything was in SRAM). */
186   /* __stack = 0x8000A000; */
187  /* DWARF debug sections.
188     Symbols in the DWARF debugging sections are relative to
189     the beginning of the section so we begin them at 0.  */
190
191  /* DWARF 1 */
192  .debug          0 : { *(.debug) }
193  .line           0 : { *(.line) }
194
195  /* GNU DWARF 1 extensions */
196  .debug_srcinfo  0 : { *(.debug_srcinfo) }
197  .debug_sfnames  0 : { *(.debug_sfnames) }
198
199  /* DWARF 1.1 and DWARF 2 */
200  .debug_aranges  0 : { *(.debug_aranges) }
201  .debug_pubnames 0 : { *(.debug_pubnames) }
202
203  /* DWARF 2 */
204  .debug_info     0 : { *(.debug_info) }
205  .debug_abbrev   0 : { *(.debug_abbrev) }
206  .debug_line     0 : { *(.debug_line) }
207  .debug_frame    0 : { *(.debug_frame) }
208  .debug_str      0 : { *(.debug_str) }
209  .debug_loc      0 : { *(.debug_loc) }
210  .debug_macinfo  0 : { *(.debug_macinfo) }
211
212  /* SGI/MIPS DWARF 2 extensions */
213  .debug_weaknames 0 : { *(.debug_weaknames) }
214  .debug_funcnames 0 : { *(.debug_funcnames) }
215  .debug_typenames 0 : { *(.debug_typenames) }
216  .debug_varnames  0 : { *(.debug_varnames) }
217}
Note: See TracBrowser for help on using the repository browser.