source: rtems/c/src/lib/libbsp/arm/shared/startup/linkcmds.base @ 39c8fdb

4.104.115
Last change on this file since 39c8fdb was 39c8fdb, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 01/12/10 at 15:03:22

add support for lpc32xx

  • Property mode set to 100644
File size: 10.5 KB
Line 
1/**
2 * @file
3 *
4 * @ingroup bsp_linker
5 *
6 * @brief Linker command base file.
7 */
8
9/*
10 * Copyright (c) 2008
11 * Embedded Brains GmbH
12 * Obere Lagerstr. 30
13 * D-82178 Puchheim
14 * Germany
15 * rtems@embedded-brains.de
16 *
17 * The license and distribution terms for this file may be found in the file
18 * LICENSE in this distribution or at http://www.rtems.com/license/LICENSE.
19 */
20
21OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
22
23OUTPUT_ARCH (arm)
24
25ENTRY (start)
26
27/*
28 * BSP: Global symbols that may be defined externally
29 */
30
31bsp_stack_align = DEFINED (bsp_stack_align) ? bsp_stack_align : 4;
32
33bsp_section_align = DEFINED (bsp_section_align) ? bsp_section_align : 32;
34
35bsp_section_start_end_align = DEFINED (bsp_section_start_end_align) ? bsp_section_start_end_align : bsp_section_align;
36bsp_section_vector_end_align = DEFINED (bsp_section_vector_end_align) ? bsp_section_vector_end_align : bsp_section_align;
37bsp_section_text_end_align = DEFINED (bsp_section_text_end_align) ? bsp_section_text_end_align : bsp_section_align;
38bsp_section_rodata_end_align = DEFINED (bsp_section_rodata_end_align) ? bsp_section_rodata_end_align : bsp_section_align;
39bsp_section_data_end_align = DEFINED (bsp_section_data_end_align) ? bsp_section_data_end_align : bsp_section_align;
40bsp_section_fast_end_align = DEFINED (bsp_section_fast_end_align) ? bsp_section_fast_end_align : bsp_section_align;
41bsp_section_bss_end_align = DEFINED (bsp_section_bss_end_align) ? bsp_section_bss_end_align : bsp_section_align;
42
43bsp_section_vbarrier_align = DEFINED (bsp_section_vbarrier_align) ? bsp_section_vbarrier_align : 1;
44bsp_section_robarrier_align = DEFINED (bsp_section_robarrier_align) ? bsp_section_robarrier_align : 1;
45
46bsp_stack_abt_size = DEFINED (bsp_stack_abt_size) ? bsp_stack_abt_size : 128;
47bsp_stack_abt_size = ALIGN (bsp_stack_abt_size, bsp_stack_align);
48
49bsp_stack_fiq_size = DEFINED (bsp_stack_fiq_size) ? bsp_stack_fiq_size : 128;
50bsp_stack_fiq_size = ALIGN (bsp_stack_fiq_size, bsp_stack_align);
51
52bsp_stack_irq_size = DEFINED (bsp_stack_irq_size) ? bsp_stack_irq_size : 512;
53bsp_stack_irq_size = ALIGN (bsp_stack_irq_size, bsp_stack_align);
54
55bsp_stack_svc_size = DEFINED (bsp_stack_svc_size) ? bsp_stack_svc_size : 512;
56bsp_stack_svc_size = ALIGN (bsp_stack_svc_size, bsp_stack_align);
57
58bsp_stack_und_size = DEFINED (bsp_stack_und_size) ? bsp_stack_und_size : 128;
59bsp_stack_und_size = ALIGN (bsp_stack_und_size, bsp_stack_align);
60
61SECTIONS {
62        .start : {
63                /*
64                 * BSP: Begin of start section
65                 */
66                bsp_section_start_begin = .;
67
68                /*
69                 * BSP: System startup entry
70                 */
71                KEEP (*(.bsp_start))
72                KEEP (*(.bsp_start_data))
73
74                . = ALIGN (bsp_section_start_end_align);
75
76                /*
77                 * BSP: End of start section
78                 */
79                bsp_section_start_end = .;
80        } > REGION_START AT > REGION_START
81
82        bsp_section_start_size = bsp_section_start_end - bsp_section_start_begin;
83
84        .vector : {
85                /*
86                 * BSP: Begin of vector section
87                 */
88                bsp_section_vector_begin = .;
89
90                /*
91                 * BSP: Reserve space for the the exception vector table and
92                 * the pointers to the default exceptions handlers.
93                 */
94                . = . + 64;
95
96                /*
97                 * BSP: Reserve space for mode stacks
98                 */
99
100                . = ALIGN (bsp_stack_align);
101
102                bsp_stack_abt_begin = .;
103                . = . + bsp_stack_abt_size;
104                bsp_stack_abt_end = .;
105
106                bsp_stack_fiq_begin = .;
107                . = . + bsp_stack_fiq_size;
108                bsp_stack_fiq_end = .;
109
110                bsp_stack_irq_begin = .;
111                . = . + bsp_stack_irq_size;
112                bsp_stack_irq_end = .;
113
114                bsp_stack_svc_begin = .;
115                . = . + bsp_stack_svc_size;
116                bsp_stack_svc_end = .;
117
118                bsp_stack_und_begin = .;
119                . = . + bsp_stack_und_size;
120                bsp_stack_und_end = .;
121
122                /*
123                 * BSP: Special vector data
124                 */
125                *(.bsp_vector)
126
127                . = ALIGN (bsp_section_vector_end_align);
128
129                /*
130                 * BSP: End of vector section
131                 */
132                bsp_section_vector_end = .;
133        } > REGION_VECTOR AT > REGION_VECTOR
134
135        bsp_section_vector_size = bsp_section_vector_end - bsp_section_vector_begin;
136
137        .vbarrier : {
138                . = ALIGN (bsp_section_vbarrier_align);
139        } > REGION_VECTOR
140
141        .text : {
142                /*
143                 * BSP: Begin of text section
144                 */
145                bsp_section_text_begin = .;
146
147                /*
148                 * BSP: Moved into .text from .init
149                 */
150                KEEP (*(.init))
151
152                *(.text .stub .text.* .gnu.linkonce.t.*)
153                KEEP (*(.text.*personality*))
154                /* .gnu.warning sections are handled specially by elf32.em.  */
155                *(.gnu.warning)
156
157                /*
158                 * BSP: Magic ARM stuff
159                 */
160                *(.ARM.*)
161                *(.glue_7)
162                *(.glue_7t)
163                *(.vfp11_veneer)
164               
165                /*
166                 * BSP: Special FreeBSD sysctl sections
167                 */
168                . = ALIGN (16);
169                __start_set_sysctl_set = .;
170                *(set_sysctl_*);
171                __stop_set_sysctl_set = ABSOLUTE(.);
172                *(set_domain_*);
173                *(set_pseudo_*);
174
175                /*
176                 * BSP: Moved into .text from .*
177                 */
178                *(.eh_frame_hdr)
179
180                /*
181                 * BSP: Required by cpukit/score/src/threadhandler.c
182                 */
183                PROVIDE (_fini = .);
184
185                /*
186                 * BSP: Moved into .text from .fini
187                 */
188                KEEP (*(.fini))
189
190                . = ALIGN (bsp_section_text_end_align);
191
192                /*
193                 * BSP: End of text section
194                 */
195                bsp_section_text_end = .;
196        } > REGION_TEXT AT > REGION_TEXT_LOAD
197
198        bsp_section_text_size = bsp_section_text_end - bsp_section_text_begin;
199
200        bsp_section_text_load_begin = LOADADDR (.text);
201
202        .rodata : {
203                /*
204                 * BSP: Begin of rodata section
205                 */
206                bsp_section_rodata_begin = .;
207
208                __start_set_modmetadata_set = .;
209                *(set_modmetadata_set);
210                __stop_set_modmetadata_set = .;
211
212                /*
213                 * BSP: Moved into .rodata from .*
214                 */
215                *(.rodata .rodata.* .gnu.linkonce.r.*)
216                *(.rodata1)
217
218                . = ALIGN (bsp_section_rodata_end_align);
219
220                /*
221                 * BSP: End of rodata section
222                 */
223                bsp_section_rodata_end = .;
224        } > REGION_RODATA AT > REGION_RODATA_LOAD
225
226        bsp_section_rodata_size = bsp_section_rodata_end - bsp_section_rodata_begin;
227
228        bsp_section_rodata_load_begin = LOADADDR (.rodata);
229
230        .robarrier : {
231                . = ALIGN (bsp_section_robarrier_align);
232        } > REGION_RODATA
233
234        .data : {
235                /*
236                 * BSP: Begin of data section
237                 */
238                bsp_section_data_begin = .;
239
240                /*
241                 * BSP: Moved into .data from .ctors
242                 */
243                /* gcc uses crtbegin.o to find the start of
244                   the constructors, so we make sure it is
245                   first.  Because this is a wildcard, it
246                   doesn't matter if the user does not
247                   actually link against crtbegin.o; the
248                   linker won't look for a file to match a
249                   wildcard.  The wildcard also means that it
250                   doesn't matter which directory crtbegin.o
251                   is in.  */
252                KEEP (*crtbegin.o(.ctors))
253                KEEP (*crtbegin?.o(.ctors))
254                /* We don't want to include the .ctor section from
255                   the crtend.o file until after the sorted ctors.
256                   The .ctor section from the crtend file contains the
257                   end of ctors marker and it must be last */
258                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
259                KEEP (*(SORT(.ctors.*)))
260                KEEP (*(.ctors))
261
262                /*
263                 * BSP: Moved into .data from .dtors
264                 */
265                KEEP (*crtbegin.o(.dtors))
266                KEEP (*crtbegin?.o(.dtors))
267                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
268                KEEP (*(SORT(.dtors.*)))
269                KEEP (*(.dtors))
270
271                /*
272                 * BSP: Moved into .data from .*
273                 */
274                *(.data1)
275                KEEP (*(.eh_frame))
276                *(.gcc_except_table .gcc_except_table.*)
277                KEEP (*(.jcr))
278
279                *(.data .data.* .gnu.linkonce.d.*)
280                KEEP (*(.gnu.linkonce.d.*personality*))
281                SORT(CONSTRUCTORS)
282
283                . = ALIGN (bsp_section_data_end_align);
284
285                /*
286                 * BSP: End of data section
287                 */
288                bsp_section_data_end = .;
289        } > REGION_DATA AT > REGION_DATA_LOAD
290
291        bsp_section_data_size = bsp_section_data_end - bsp_section_data_begin;
292
293        bsp_section_data_load_begin = LOADADDR (.data);
294
295        .fast : {
296                bsp_section_fast_begin = .;
297
298                *(.bsp_fast)
299
300                . = ALIGN (bsp_section_fast_end_align);
301
302                bsp_section_fast_end = .;
303        } > REGION_FAST AT > REGION_FAST_LOAD
304
305        bsp_section_fast_size = bsp_section_fast_end - bsp_section_fast_begin;
306
307        bsp_section_fast_load_begin = LOADADDR (.fast);
308
309        .bss : {
310                /*
311                 * BSP: Begin of bss section
312                 */
313                bsp_section_bss_begin = .;
314
315                *(COMMON)
316                *(.dynbss)
317                *(.bss .bss.* .gnu.linkonce.b.*)
318
319                . = ALIGN (bsp_section_bss_end_align);
320
321                /*
322                 * BSP: End of bss section
323                 */
324                bsp_section_bss_end = .;
325        } > REGION_BSS AT > REGION_BSS
326
327        bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
328
329        .work : {
330                /*
331                 * BSP: Begin of work section.  The work section will occupy
332                 * the remaining REGION_WORK region and contains the RTEMS work
333                 * space and heap.
334                 */
335                bsp_section_work_begin = .;
336
337                . += ORIGIN (REGION_WORK) + LENGTH (REGION_WORK) - ABSOLUTE (.);
338
339                /*
340                 * BSP: End of work section
341                 */
342                bsp_section_work_end = .;
343        } > REGION_WORK AT > REGION_WORK
344
345        bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
346
347        .stack : {
348                /*
349                 * BSP: Begin of stack section.  The stack section will occupy
350                 * the remaining REGION_STACK region and may contain the task
351                 * stacks.  Depending on the region distribution this section
352                 * may be of zero size.
353                 */
354                bsp_section_stack_begin = .;
355
356                . += ORIGIN (REGION_STACK) + LENGTH (REGION_STACK) - ABSOLUTE (.);
357
358                /*
359                 * BSP: End of stack section
360                 */
361                bsp_section_stack_end = .;
362        } > REGION_STACK AT > REGION_STACK
363
364        bsp_section_stack_size = bsp_section_stack_end - bsp_section_stack_begin;
365
366        /*
367         * BSP: External symbols (FIXME)
368         */
369        RamBase = ORIGIN (REGION_WORK);
370        RamSize = LENGTH (REGION_WORK);
371        WorkAreaBase = bsp_section_work_begin;
372        HeapSize = 0;
373       
374        /* Stabs debugging sections.  */
375        .stab          0 : { *(.stab) }
376        .stabstr       0 : { *(.stabstr) }
377        .stab.excl     0 : { *(.stab.excl) }
378        .stab.exclstr  0 : { *(.stab.exclstr) }
379        .stab.index    0 : { *(.stab.index) }
380        .stab.indexstr 0 : { *(.stab.indexstr) }
381        .comment       0 : { *(.comment) }
382        /* DWARF debug sections.
383           Symbols in the DWARF debugging sections are relative to the beginning
384           of the section so we begin them at 0.  */
385        /* DWARF 1 */
386        .debug          0 : { *(.debug) }
387        .line           0 : { *(.line) }
388        /* GNU DWARF 1 extensions */
389        .debug_srcinfo  0 : { *(.debug_srcinfo) }
390        .debug_sfnames  0 : { *(.debug_sfnames) }
391        /* DWARF 1.1 and DWARF 2 */
392        .debug_aranges  0 : { *(.debug_aranges) }
393        .debug_pubnames 0 : { *(.debug_pubnames) }
394        /* DWARF 2 */
395        .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
396        .debug_abbrev   0 : { *(.debug_abbrev) }
397        .debug_line     0 : { *(.debug_line) }
398        .debug_frame    0 : { *(.debug_frame) }
399        .debug_str      0 : { *(.debug_str) }
400        .debug_loc      0 : { *(.debug_loc) }
401        .debug_macinfo  0 : { *(.debug_macinfo) }
402        /* SGI/MIPS DWARF 2 extensions */
403        .debug_weaknames 0 : { *(.debug_weaknames) }
404        .debug_funcnames 0 : { *(.debug_funcnames) }
405        .debug_typenames 0 : { *(.debug_typenames) }
406        .debug_varnames  0 : { *(.debug_varnames) }
407        /* DWARF 3 */
408        .debug_pubtypes 0 : { *(.debug_pubtypes) }
409        .debug_ranges   0 : { *(.debug_ranges) }
410        .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
411
412        /DISCARD/ : {
413                *(.note.GNU-stack) *(.gnu_debuglink)
414        }
415
416        /*
417         * BSP: Catch all unknown sections
418         */
419        .nirvana : {
420                *(*)
421        } > NIRVANA
422}
Note: See TracBrowser for help on using the repository browser.