source: rtems/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.base @ 6d9ab345

4.115
Last change on this file since 6d9ab345 was fd153c73, checked in by Sebastian Huber <sebastian.huber@…>, on 06/12/12 at 13:27:17

bsps: Replace NIRVANA region

Replace the "NIRVANA" region with the more verbose "UNEXPECTED_SECTIONS"
region. Move the region definition into the "linkcmds.base" files.

  • Property mode set to 100644
File size: 7.6 KB
Line 
1/**
2 * @file
3 *
4 * Derived from internal linker script of GNU ld (GNU Binutils) 2.18 for elf32ppc emulation.
5 */
6
7OUTPUT_FORMAT ("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
8OUTPUT_ARCH (powerpc)
9ENTRY (start)
10
11bsp_ram_start = ORIGIN (RAM);
12bsp_ram_end = ORIGIN (RAM) + LENGTH (RAM);
13bsp_ram_size = LENGTH (RAM);
14
15bsp_rom_start = ORIGIN (ROM);
16bsp_rom_end = ORIGIN (ROM) + LENGTH (ROM);
17bsp_rom_size = LENGTH (ROM);
18
19bsp_dpram_start = ORIGIN (DPRAM);
20bsp_dpram_end = ORIGIN (DPRAM) + LENGTH (DPRAM);
21bsp_dpram_size = LENGTH (DPRAM);
22
23bsp_section_align = 32;
24
25RamBase = bsp_ram_start;
26RamSize = bsp_ram_size;
27HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
28
29MEMORY {
30        UNEXPECTED_SECTIONS : ORIGIN = 0xffffffff, LENGTH = 0
31}
32
33SECTIONS {
34        /*
35         * BSP: MPC5200 registers
36         */
37        .regs (NOLOAD) : {
38                MBAR = .;
39                mpc5200 = .;
40        } > REGS
41
42        /*
43         * BSP: Exception vectors
44         */
45        .vectors 0x100 : {
46                *(.vectors)
47        } > RAM
48
49        /*
50         * BSP: The initial stack will live in this area - between the vectors
51         * and the text section.
52         */
53
54        .text 0x10000 : {
55                /*
56                 * BSP: Start of text section
57                 */
58                bsp_section_text_start = .;
59
60                /*
61                 * BSP: System startup entry
62                 */
63                KEEP (*(.entry))
64
65                /*
66                 * BSP: Moved into .text from .init
67                 */
68                KEEP (*(.init))
69
70                *(.text .stub .text.* .gnu.linkonce.t.*)
71                KEEP (*(.text.*personality*))
72                /* .gnu.warning sections are handled specially by elf32.em.  */
73                *(.gnu.warning)
74                *(.glink)
75               
76                /*
77                 * BSP: Special FreeBSD sysctl sections
78                 */
79                . = ALIGN (16);
80                __start_set_sysctl_set = .;
81                *(set_sysctl_*);
82                __stop_set_sysctl_set = ABSOLUTE(.);
83                *(set_domain_*);
84                *(set_pseudo_*);
85
86                /*
87                 * BSP: Moved into .text from .*
88                 */
89                *(.rodata .rodata.* .gnu.linkonce.r.*)
90                *(.rodata1)
91                *(.interp)
92                *(.note.gnu.build-id)
93                *(.hash)
94                *(.gnu.hash)
95                *(.dynsym)
96                *(.dynstr)
97                *(.gnu.version)
98                *(.gnu.version_d)
99                *(.gnu.version_r)
100                *(.eh_frame_hdr)
101
102                /*
103                 * BSP: Magic PPC stuff
104                 */
105                *(.PPC.*)
106
107                /*
108                 * BSP: Required by cpukit/score/src/threadhandler.c
109                 */
110                PROVIDE (_fini = .);
111
112                /*
113                 * BSP: Moved into .text from .fini
114                 */
115                KEEP (*(.fini))
116
117                . = ALIGN (bsp_section_align);
118
119                PROVIDE (__etext = .);
120                PROVIDE (_etext = .);
121                PROVIDE (etext = .);
122        } > RAM
123
124        .sdata2 : {
125                PROVIDE (_SDA2_BASE_ = 32768);
126
127                *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
128
129                . = ALIGN (bsp_section_align);
130        } > RAM
131
132        .sbss2 : {
133                *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
134
135                . = ALIGN (bsp_section_align);
136
137                /*
138                 * BSP: End of text section
139                 */
140                bsp_section_text_end = .;
141        } > RAM
142
143        .data : {
144                /*
145                 * BSP: Start of data section
146                 */
147                bsp_section_data_start = .;
148
149                /*
150                 * BSP: Moved into .data from .ctors
151                 */
152                /* gcc uses crtbegin.o to find the start of
153                   the constructors, so we make sure it is
154                   first.  Because this is a wildcard, it
155                   doesn't matter if the user does not
156                   actually link against crtbegin.o; the
157                   linker won't look for a file to match a
158                   wildcard.  The wildcard also means that it
159                   doesn't matter which directory crtbegin.o
160                   is in.  */
161                KEEP (*crtbegin.o(.ctors))
162                KEEP (*crtbegin?.o(.ctors))
163                /* We don't want to include the .ctor section from
164                   the crtend.o file until after the sorted ctors.
165                   The .ctor section from the crtend file contains the
166                   end of ctors marker and it must be last */
167                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
168                KEEP (*(SORT(.ctors.*)))
169                KEEP (*(.ctors))
170
171                /*
172                 * BSP: Moved into .data from .dtors
173                 */
174                KEEP (*crtbegin.o(.dtors))
175                KEEP (*crtbegin?.o(.dtors))
176                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
177                KEEP (*(SORT(.dtors.*)))
178                KEEP (*(.dtors))
179
180                /*
181                 * BSP: Moved into .data from .*
182                 */
183                *(.tdata .tdata.* .gnu.linkonce.td.*)
184                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
185                *(.data1)
186                KEEP (*(.eh_frame))
187                *(.gcc_except_table .gcc_except_table.*)
188                KEEP (*(.jcr))
189                *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*)
190                *(.fixup)
191                *(.got1)
192                *(.got2)
193                *(.dynamic)
194                *(.got)
195                *(.plt)
196                PROVIDE_HIDDEN (__preinit_array_start = .);
197                KEEP (*(.preinit_array))
198                PROVIDE_HIDDEN (__preinit_array_end = .);
199                PROVIDE_HIDDEN (__init_array_start = .);
200                KEEP (*(SORT(.init_array.*)))
201                KEEP (*(.init_array))
202                PROVIDE_HIDDEN (__init_array_end = .);
203                PROVIDE_HIDDEN (__fini_array_start = .);
204                KEEP (*(.fini_array))
205                KEEP (*(SORT(.fini_array.*)))
206                PROVIDE_HIDDEN (__fini_array_end = .);
207
208                *(.data .data.* .gnu.linkonce.d.*)
209                KEEP (*(.gnu.linkonce.d.*personality*))
210                SORT(CONSTRUCTORS)
211
212                . = ALIGN (bsp_section_align);
213        } > RAM
214
215        .sdata : {
216                PROVIDE (_SDA_BASE_ = 32768);
217                *(.sdata .sdata.* .gnu.linkonce.s.*)
218
219                . = ALIGN (bsp_section_align);
220
221                _edata = .;
222                PROVIDE (edata = .);
223
224                /*
225                 * BSP: End of data section
226                 */
227                bsp_section_data_end = .;
228        } > RAM
229
230        .sbss : {
231                /*
232                 * BSP: Start of bss section
233                 */
234                bsp_section_bss_start = .;
235
236                __bss_start = .;
237
238                PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
239                *(.scommon)
240                *(.dynsbss)
241                *(.sbss .sbss.* .gnu.linkonce.sb.*)
242                PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
243
244                . = ALIGN (bsp_section_align);
245        } > RAM
246
247        .bss : {
248                *(COMMON)
249                *(.dynbss)
250                *(.bss .bss.* .gnu.linkonce.b.*)
251
252                . = ALIGN (bsp_section_align);
253
254                __end = .;
255                _end = .;
256                PROVIDE (end = .);
257
258                /*
259                 * BSP: End of bss section
260                 */
261                bsp_section_bss_end = .;
262        } > RAM
263
264        /*
265         * BSP: Section sizes
266         */
267        bsp_section_text_size = bsp_section_text_end - bsp_section_text_start;
268        bsp_section_data_size = bsp_section_data_end - bsp_section_data_start;
269        bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_start;
270
271        /*
272         * BSP: Interrupt stack
273         */
274        bsp_interrupt_stack_start = bsp_section_bss_end;
275        bsp_interrupt_stack_end = bsp_interrupt_stack_start + 32k;
276        bsp_interrupt_stack_size = bsp_interrupt_stack_end - bsp_interrupt_stack_start;
277
278        /*
279         * BSP: Work area start
280         */
281        bsp_work_area_start = bsp_interrupt_stack_end;
282        WorkAreaBase = bsp_work_area_start;
283       
284        /* Stabs debugging sections.  */
285        .stab          0 : { *(.stab) }
286        .stabstr       0 : { *(.stabstr) }
287        .stab.excl     0 : { *(.stab.excl) }
288        .stab.exclstr  0 : { *(.stab.exclstr) }
289        .stab.index    0 : { *(.stab.index) }
290        .stab.indexstr 0 : { *(.stab.indexstr) }
291        .comment       0 : { *(.comment) }
292        /* DWARF debug sections.
293           Symbols in the DWARF debugging sections are relative to the beginning
294           of the section so we begin them at 0.  */
295        /* DWARF 1 */
296        .debug          0 : { *(.debug) }
297        .line           0 : { *(.line) }
298        /* GNU DWARF 1 extensions */
299        .debug_srcinfo  0 : { *(.debug_srcinfo) }
300        .debug_sfnames  0 : { *(.debug_sfnames) }
301        /* DWARF 1.1 and DWARF 2 */
302        .debug_aranges  0 : { *(.debug_aranges) }
303        .debug_pubnames 0 : { *(.debug_pubnames) }
304        /* DWARF 2 */
305        .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
306        .debug_abbrev   0 : { *(.debug_abbrev) }
307        .debug_line     0 : { *(.debug_line) }
308        .debug_frame    0 : { *(.debug_frame) }
309        .debug_str      0 : { *(.debug_str) }
310        .debug_loc      0 : { *(.debug_loc) }
311        .debug_macinfo  0 : { *(.debug_macinfo) }
312        /* SGI/MIPS DWARF 2 extensions */
313        .debug_weaknames 0 : { *(.debug_weaknames) }
314        .debug_funcnames 0 : { *(.debug_funcnames) }
315        .debug_typenames 0 : { *(.debug_typenames) }
316        .debug_varnames  0 : { *(.debug_varnames) }
317        /* DWARF 3 */
318        .debug_pubtypes 0 : { *(.debug_pubtypes) }
319        .debug_ranges   0 : { *(.debug_ranges) }
320        .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
321
322        /DISCARD/ : {
323                *(.note.GNU-stack) *(.gnu_debuglink)
324        }
325
326        /*
327         * This is a RTEMS specific section to catch all unexpected input
328         * sections.  In case you get an error like
329         *   "section `.unexpected_sections' will not fit in region
330         *   `UNEXPECTED_SECTIONS'"
331         * you have to figure out the offending input section and add it to the
332         * appropriate output section definition above.
333         */
334        .unexpected_sections : { *(*) } > UNEXPECTED_SECTIONS
335}
Note: See TracBrowser for help on using the repository browser.