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