source: rtems/bsps/v850/gdbv850sim/start/linkcmds @ ffa1153

5
Last change on this file since ffa1153 was ffa1153, checked in by Sebastian Huber <sebastian.huber@…>, on 12/14/19 at 20:36:09

bsps: Add RamEnd? to linker command files

Update #3838.

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