source: rtems/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.base @ fd153c73

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