source: rtems/c/src/lib/libbsp/lm32/lm32_evr/startup/linkcmds @ 0fd617e2

5
Last change on this file since 0fd617e2 was 0fd617e2, checked in by Joel Sherrill <joel@…>, on 12/18/17 at 19:59:58

lm32_evr: Simplify bsp_specs

Updates #3520.

  • Property mode set to 100644
File size: 10.0 KB
Line 
1OUTPUT_FORMAT("elf32-lm32", "elf32-lm32",
2              "elf32-lm32")
3OUTPUT_ARCH(lm32)
4ENTRY(start)
5STARTUP(start.o)
6/* Do we need any of these for elf?
7   __DYNAMIC = 0;    */
8
9/*
10 * Declare some sizes. Heap is sized at whatever ram space is left.
11 */
12RamBase = DEFINED(RamBase) ? RamBase : 0x08000000;
13RamSize = DEFINED(RamSize) ? RamSize : 32M;
14HeapSize = DEFINED(HeapSize) ? HeapSize : 2M;
15_StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
16
17PROVIDE (__stack = 0);
18MEMORY {
19        ebr     : ORIGIN = 0x04000000 , LENGTH = 32k
20        sdram   : ORIGIN = 0x08000000 , LENGTH = 32M
21}
22SECTIONS
23{
24  .boot :
25  {
26    KEEP (*(.boot))
27  } > ebr
28
29  /* Read-only sections, merged into text segment: */
30  .interp   : { *(.interp) }    > sdram
31  .hash           : { *(.hash)          }       > sdram
32  .dynsym         : { *(.dynsym)                }       > sdram
33  .dynstr         : { *(.dynstr)                }       > sdram
34  .gnu.version   : { *(.gnu.version)      }     > sdram
35  .gnu.version_d   : { *(.gnu.version_d)  }     > sdram
36  .gnu.version_r   : { *(.gnu.version_r)  }     > sdram
37  .rela.text     :
38    { *(.rela.text) *(.rela.gnu.linkonce.t*) }  > sdram
39  .rela.data     :
40    { *(.rela.data) *(.rela.gnu.linkonce.d*) }  > sdram
41  .rela.rodata   :
42    { *(.rela.rodata*) *(.rela.gnu.linkonce.r*) }       > sdram
43  .rela.got       : { *(.rela.got)      }       > sdram
44  .rela.got1      : { *(.rela.got1)     }       > sdram
45  .rela.got2      : { *(.rela.got2)     }       > sdram
46  .rela.ctors     : { *(.rela.ctors)    }       > sdram
47  .rela.dtors     : { *(.rela.dtors)    }       > sdram
48  .rela.init      : { *(.rela.init)     }       > sdram
49  .rela.fini      : { *(.rela.fini)     }       > sdram
50  .rela.bss       : { *(.rela.bss)      }       > sdram
51  .rela.plt       : { *(.rela.plt)      }       > sdram
52  .rela.sdata     : { *(.rela.sdata)    }       > sdram
53  .rela.sbss      : { *(.rela.sbss)     }       > sdram
54  .rela.sdata2    : { *(.rela.sdata2)   }       > sdram
55  .rela.sbss2     : { *(.rela.sbss2)    }       > sdram
56  .rela.dyn       : { *(.rela.dyn)      }       > sdram
57
58  .init           : { KEEP(*(.init))            } > sdram
59
60  .text      : 
61  {
62    *(.text*)   
63
64    /*
65     * Special FreeBSD sysctl sections.
66     */
67    . = ALIGN (16);
68    __start_set_sysctl_set = .;
69    *(set_sysctl_*);
70    __stop_set_sysctl_set = ABSOLUTE(.);
71    *(set_domain_*);
72    *(set_pseudo_*);
73
74    /* .gnu.warning sections are handled specially by elf32.em.  */
75    *(.gnu.warning)
76    *(.gnu.linkonce.t*)
77  }  > sdram
78
79  .fini           : { _fini = .; KEEP(*(.fini)) } > sdram
80
81  .rodata         : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) }   > sdram
82  .rodata1        : { *(.rodata1) }     > sdram
83  .tdata : {
84    _TLS_Data_begin = .;
85    *(.tdata .tdata.* .gnu.linkonce.td.*)
86    _TLS_Data_end = .;
87  } > sdram
88  .tbss : {
89    _TLS_BSS_begin = .;
90    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
91    _TLS_BSS_end = .;
92  } > sdram
93  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
94  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
95  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
96  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
97  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
98  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
99
100  /* Adjust the address for the data segment.  We want to adjust up to
101     the same address within the page on the next page up.  */
102  . = ALIGN(0x10000) + (. & (0x10000 - 1));
103  /* Ensure the __preinit_array_start label is properly aligned.  We
104     could instead move the label definition inside the section, but
105     the linker would then create the section even if it turns out to
106     be empty, which isn't pretty.  */
107  . = ALIGN(32 / 8);
108  PROVIDE (__preinit_array_start = .);
109  .preinit_array     : { *(.preinit_array) } >sdram
110  PROVIDE (__preinit_array_end = .);
111  PROVIDE (__init_array_start = .);
112  .init_array     : { *(.init_array) } >sdram
113  PROVIDE (__init_array_end = .);
114  PROVIDE (__fini_array_start = .);
115  .fini_array     : { *(.fini_array) } >sdram
116  PROVIDE (__fini_array_end = .);
117
118/* _SDA2_BASE_ = __SDATA2_START__ + 0x8000; */
119  .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } >sdram
120  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
121                        /* avoid empty sdata2/sbss2 area -- __eabi would not set up r2
122                         * which may be important if run-time loading is used
123                         */
124                     . += 1;
125                    } >sdram
126  .eh_frame       : { *.(eh_frame)              } >sdram
127
128  /* NOTE: if the BSP uses page tables, the correctness of
129   *       '_etext' (and __DATA_START__) is CRUCIAL - otherwise,
130   *       an invalid mapping may result!!!
131   */
132  _etext = .;
133  PROVIDE (etext = .);
134
135  /* Adjust the address for the data segment.  We want to adjust up to
136     the same address within the page on the next page up.  It would
137     be more correct to do this:
138       . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
139     The current expression does not correctly handle the case of a
140     text segment ending precisely at the end of a page; it causes the
141     data segment to skip a page.  The above expression does not have
142     this problem, but it will currently (2/95) cause BFD to allocate
143     a single segment, combining both text and data, for this case.
144     This will prevent the text segment from being shared among
145     multiple executions of the program; I think that is more
146     important than losing a page of the virtual address space (note
147     that no actual memory is lost; the page which is skipped can not
148     be referenced).  */
149  . = ALIGN(0x1000);
150 .data ALIGN(0x1000) :
151  {
152   /* NOTE: if the BSP uses page tables, the correctness of
153    *       '__DATA_START__' (and _etext) is CRUCIAL - otherwise,
154    *       an invalid mapping may result!!!
155    */
156        PROVIDE(__DATA_START__ = ABSOLUTE(.) );
157    *(.data .data.* .gnu.linkonce.d*)   
158    KEEP (*(SORT(.rtemsrwset.*)))
159    SORT(CONSTRUCTORS)
160  } > sdram
161  .data1   : { *(.data1) }      > sdram
162  PROVIDE (__EXCEPT_START__ = .);
163  .gcc_except_table   : {
164    *(.gcc_except_table)
165    *(.gcc_except_table.*)
166  } > sdram
167  PROVIDE (__EXCEPT_END__ = .);
168  .got1           : { *(.got1) }        > sdram
169  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
170     get relocated with -mrelocatable. Also put in the .fixup pointers.
171     The current compiler no longer needs this, but keep it around for 2.7.2  */
172                PROVIDE (_GOT2_START_ = .);
173  .got2           :  { *(.got2) }       > sdram
174  .dynamic        : { *(.dynamic) }     > sdram
175
176  .ctors          :
177  {
178    /* gcc uses crtbegin.o to find the start of
179       the constructors, so we make sure it is
180       first.  Because this is a wildcard, it
181       doesn't matter if the user does not
182       actually link against crtbegin.o; the
183       linker won't look for a file to match a
184       wildcard.  The wildcard also means that it
185       doesn't matter which directory crtbegin.o
186       is in.  */
187    KEEP (*crtbegin.o(.ctors))
188    /* We don't want to include the .ctor section from
189       from the crtend.o file until after the sorted ctors.
190       The .ctor section from the crtend file contains the
191       end of ctors marker and it must be last */
192    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
193    KEEP (*(SORT(.ctors.*)))
194    KEEP (*(.ctors))
195  } > sdram
196  .dtors          :
197  {
198    KEEP (*crtbegin.o(.dtors))
199    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
200    KEEP (*(SORT(.dtors.*)))
201    KEEP (*(.dtors))
202  } > sdram
203
204
205                PROVIDE (_FIXUP_START_ = .);
206  .fixup          : { *(.fixup) }       > sdram
207                PROVIDE (_FIXUP_END_ = .);
208                PROVIDE (_GOT2_END_ = .);
209                PROVIDE (_GOT_START_ = .);
210
211  .got            : { *(.got) } > sdram
212  .got.plt        : { *(.got.plt) }     > sdram
213
214                PROVIDE (_GOT_END_ = .);
215
216  .jcr            : { KEEP (*(.jcr)) } > sdram
217
218  /* We want the small data sections together, so single-instruction offsets
219     can access them all, and initialized data all before uninitialized, so
220     we can shorten the on-disk segment size.  */
221/* _SDA_BASE_ = __SDATA_START__ + 0x8000; */
222  .sdata          : { *(.sdata*) *(.gnu.linkonce.s.*)   } >sdram
223  _edata  =  .;
224  _gp = .;
225  PROVIDE (edata = .);
226  .sbss      :
227  {
228    _clear_start = .;
229    PROVIDE (__sbss_start = .);
230    *(.dynsbss)
231    *(.sbss* .gnu.linkonce.sb.*)
232    *(.scommon)
233    /* avoid empty sdata/sbss area -- __eabi would not set up r13
234     * which may be important if run-time loading is used
235     */
236    . += 1;
237    . = ALIGN(16);
238    PROVIDE (__sbss_end = .);
239  } > sdram
240  .plt   : { *(.plt) }  > sdram
241  .bss       :
242  {
243   PROVIDE (__bss_start = .);
244   *(.dynbss)
245   *(.bss .bss* .gnu.linkonce.b*)
246   *(COMMON)
247  . = ALIGN(16);
248  _end = . ;
249  __rtems_end = . ;
250  PROVIDE (end = .);
251
252  . += _StackSize;
253  _fstack = .;
254
255  WorkAreaBase = .;
256
257    . = ALIGN (16);
258    _stack_init = .;
259    _clear_end = .;
260
261  } > sdram
262
263
264  /DISCARD/ :
265  {
266    *(.comment)
267  }
268
269
270  /* Stabs debugging sections.  */
271  .stab 0 : { *(.stab) }
272  .stabstr 0 : { *(.stabstr) }
273  .stab.excl 0 : { *(.stab.excl) }
274  .stab.exclstr 0 : { *(.stab.exclstr) }
275  .stab.index 0 : { *(.stab.index) }
276  .stab.indexstr 0 : { *(.stab.indexstr) }
277  .comment 0 : { *(.comment) }
278
279  /* DWARF debug sections.
280     Symbols in the DWARF debugging sections are relative to the beginning
281     of the section so we begin them at 0.  */
282  /* DWARF 1 */
283  .debug          0 : { *(.debug) }
284  .line           0 : { *(.line) }
285 
286  /* GNU DWARF 1 extensions */
287  .debug_srcinfo  0 : { *(.debug_srcinfo) }
288  .debug_sfnames  0 : { *(.debug_sfnames) }
289 
290  /* DWARF 1.1 and DWARF 2 */
291  .debug_aranges  0 : { *(.debug_aranges) }
292  .debug_pubnames 0 : { *(.debug_pubnames) }
293 
294  /* DWARF 2 */
295  .debug_info     0 : { *(.debug_info) }
296  .debug_abbrev   0 : { *(.debug_abbrev) }
297  .debug_line     0 : { *(.debug_line) }
298  .debug_frame    0 : { *(.debug_frame) }
299  .debug_str      0 : { *(.debug_str) }
300  .debug_loc      0 : { *(.debug_loc) }
301  .debug_macinfo  0 : { *(.debug_macinfo) }
302 
303  /* SGI/MIPS DWARF 2 extensions */
304  .debug_weaknames 0 : { *(.debug_weaknames) }
305  .debug_funcnames 0 : { *(.debug_funcnames) }
306  .debug_typenames 0 : { *(.debug_typenames) }
307  .debug_varnames  0 : { *(.debug_varnames) }
308  /* These must appear regardless of  .  */
309}
Note: See TracBrowser for help on using the repository browser.