source: rtems/c/src/lib/libbsp/v850/gdbv850sim/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: 6.4 KB
Line 
1/*
2 * Declare some sizes.
3 */
4_RamBase = DEFINED(_RamBase) ? _RamBase : 0x100000; /* RAM starts at 1MB */
5_RamSize = DEFINED(_RamSize) ? _RamSize : 0x100000; /* default is 1MB */
6_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x0;
7_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000;
8
9/* Default linker script, for normal executables */
10OUTPUT_FORMAT("elf32-v850-rh850", "elf32-v850-rh850",
11              "elf32-v850-rh850")
12OUTPUT_ARCH(v850-rh850)
13ENTRY(_start)
14/* GROUP(-lc -lsim -lgcc) */
15SEARCH_DIR(.);
16EXTERN(__ctbp __ep __gp);
17SECTIONS
18{
19  /* This saves a little space in the ELF file, since the zda starts
20     at a higher location that the ELF headers take up.  */
21  .zdata 0x160 :
22  {
23        *(.zdata)
24        *(.zbss)
25        *(reszdata)
26        *(.zcommon)
27  }
28  /* This is the read only part of the zero data area.
29     Having it as a seperate section prevents its
30     attributes from being inherited by the zdata
31     section.  Specifically it prevents the zdata
32     section from being marked READONLY.  */
33  .rozdata ALIGN (4) :
34  {
35        *(.rozdata)
36        *(romzdata)
37        *(romzbss)
38  }
39  /* Read-only sections, merged into text segment.  */
40  . = 0x100000;
41  .interp       : { *(.interp) }
42  .hash         : { *(.hash) }
43  .dynsym       : { *(.dynsym) }
44  .dynstr       : { *(.dynstr) }
45  .rel.text     : { *(.rel.text) }
46  .rela.text    : { *(.rela.text) }
47  .rel.data     : { *(.rel.data) }
48  .rela.data    : { *(.rela.data) }
49  .rel.rodata   : { *(.rel.rodata) }
50  .rela.rodata  : { *(.rela.rodata) }
51  .rel.gcc_except_table : { *(.rel.gcc_except_table) }
52  .rela.gcc_except_table : { *(.rela.gcc_except_table) }
53  .rel.got      : { *(.rel.got) }
54  .rela.got     : { *(.rela.got) }
55  .rel.ctors    : { *(.rel.ctors) }
56  .rela.ctors   : { *(.rela.ctors) }
57  .rel.dtors    : { *(.rel.dtors) }
58  .rela.dtors   : { *(.rela.dtors) }
59  .rel.init     : { *(.rel.init) }
60  .rela.init    : { *(.rela.init) }
61  .rel.fini     : { *(.rel.fini) }
62  .rela.fini    : { *(.rela.fini) }
63  .rel.bss      : { *(.rel.bss) }
64  .rela.bss     : { *(.rela.bss) }
65  .rel.plt      : { *(.rel.plt) }
66  .rela.plt     : { *(.rela.plt) }
67  .init         : { KEEP (*(.init)) } =0
68  .plt          : { *(.plt) }
69  .text         :
70  {
71    *(.text)
72    *(.text.*)
73    /* .gnu.warning sections are handled specially by elf32.em.  */
74    *(.gnu.warning)
75    *(.gnu.linkonce.t*)
76  } =0
77  _etext = .;
78  PROVIDE (etext = .);
79   /* This is special code area at the end of the normal text section.
80      It contains a small lookup table at the start followed by the
81      code pointed to by entries in the lookup table.  */
82  .call_table_data ALIGN (4) :
83  {
84    PROVIDE(__ctbp = .);
85    *(.call_table_data)
86  } = 0xff   /* Fill gaps with 0xff.  */
87  .call_table_text :
88  {
89    *(.call_table_text)
90  }
91  .fini         : { KEEP (*(.fini)) } =0
92  .rodata       : { *(.rodata .rodata.* KEEP (*(SORT(.rtemsroset.*))) .gnu.linkonce.r.*) }
93  .rodata1      : { *(.rodata1) }
94  .tdata : {
95    __TLS_Data_begin = .;
96    *(.tdata .tdata.* .gnu.linkonce.td.*)
97    __TLS_Data_end = .;
98  }
99  .tbss : {
100    __TLS_BSS_begin = .;
101    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
102    __TLS_BSS_end = .;
103  }
104  __TLS_Data_size = __TLS_Data_end - __TLS_Data_begin;
105  __TLS_Data_begin = __TLS_Data_size != 0 ? __TLS_Data_begin : __TLS_BSS_begin;
106  __TLS_Data_end = __TLS_Data_size != 0 ? __TLS_Data_end : __TLS_BSS_begin;
107  __TLS_BSS_size = __TLS_BSS_end - __TLS_BSS_begin;
108  __TLS_Size = __TLS_BSS_end - __TLS_Data_begin;
109  __TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
110  .data         :
111  {
112    *(.data)
113    *(.data.*)
114    KEEP (*(SORT(.rtemsrwset.*)))
115    *(.gnu.linkonce.d*)
116    CONSTRUCTORS
117  }
118  .data1        : { *(.data1) }
119  .ctors        :
120  {
121    ___ctors = .;
122    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
123    KEEP (*(SORT(.ctors.*)))
124    KEEP (*crtend(.ctors))
125    ___ctors_end = .;
126  }
127  .dtors        :
128  {
129    ___dtors = .;
130    KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
131    KEEP (*(SORT(.dtors.*)))
132    KEEP (*crtend.o(.dtors))
133    ___dtors_end = .;
134  }
135  .jcr          :
136  {
137    KEEP (*(.jcr))
138  }
139  .gcc_except_table : { *(.gcc_except_table) }
140  .got          : { *(.got.plt) *(.got) }
141  .dynamic      : { *(.dynamic) }
142  .tdata ALIGN (4) :
143  {
144        PROVIDE (__ep = .);
145        *(.tbyte)
146        *(.tcommon_byte)
147        *(.tdata)
148        *(.tbss)
149        *(.tcommon)
150  }
151  /* We want the small data sections together, so single-instruction offsets
152     can access them all, and initialized data all before uninitialized, so
153     we can shorten the on-disk segment size.  */
154  .sdata ALIGN (4) :
155  {
156        PROVIDE (__gp = . + 0x8000);
157        *(.sdata)
158   }
159  /* See comment about .rozdata. */
160  .rosdata ALIGN (4) :
161  {
162        *(.rosdata)
163  }
164  /* We place the .sbss data section AFTER the .rosdata section, so that
165     it can directly preceed the .bss section.  This allows runtime startup
166     code to initialise all the zero-data sections by simply taking the
167     value of '_edata' and zeroing until it reaches '_end'.  */
168  .sbss :
169  {
170        __sbss_start = .;
171        *(.sbss)
172        *(.scommon)
173  }
174  _edata  = DEFINED (__sbss_start) ? __sbss_start : . ;
175  PROVIDE (edata = _edata);
176  .bss       :
177  {
178        __bss_start = DEFINED (__sbss_start) ? __sbss_start : . ;
179        __real_bss_start = . ;
180        *(.dynbss)
181        *(.bss)
182        *(COMMON)
183  }
184  . += _StackSize;
185  _stack = .;
186  _WorkAreaBase = .;
187  _end = . ;
188  PROVIDE (end = .);
189  /* Stabs debugging sections.  */
190  .stab 0               : { *(.stab) }
191  .stabstr 0            : { *(.stabstr) }
192  .stab.excl 0          : { *(.stab.excl) }
193  .stab.exclstr 0       : { *(.stab.exclstr) }
194  .stab.index 0         : { *(.stab.index) }
195  .stab.indexstr 0      : { *(.stab.indexstr) }
196  .comment 0            : { *(.comment) }
197  /* DWARF debug sections.
198     Symbols in the DWARF debugging sections are relative to the beginning
199     of the section so we begin them at 0.  */
200  /* DWARF 1 */
201  .debug          0     : { *(.debug) }
202  .line           0     : { *(.line) }
203  /* GNU DWARF 1 extensions */
204  .debug_srcinfo  0     : { *(.debug_srcinfo) }
205  .debug_sfnames  0     : { *(.debug_sfnames) }
206  /* DWARF 1.1 and DWARF 2 */
207  .debug_aranges  0     : { *(.debug_aranges) }
208  .debug_pubnames 0     : { *(.debug_pubnames) }
209  /* DWARF 2 */
210  .debug_info     0     : { *(.debug_info) *(.gnu.linkonce.wi.*) }
211  .debug_abbrev   0     : { *(.debug_abbrev) }
212  .debug_line     0     : { *(.debug_line) }
213  .debug_frame    0     : { *(.debug_frame) }
214  .debug_str      0     : { *(.debug_str) }
215  .debug_loc      0     : { *(.debug_loc) }
216  .debug_macinfo  0     : { *(.debug_macinfo) }
217  /* SGI/MIPS DWARF 2 extensions.  */
218  .debug_weaknames 0    : { *(.debug_weaknames) }
219  .debug_funcnames 0    : { *(.debug_funcnames) }
220  .debug_typenames 0    : { *(.debug_typenames) }
221  .debug_varnames  0    : { *(.debug_varnames) }
222  /* libgloss - User stack.  */
223/*
224  .stack 0x200000       :
225  {
226        __stack = .;
227        *(.stack)
228  }
229*/
230}
231
Note: See TracBrowser for help on using the repository browser.