source: rtems/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.base @ 51c85da2

4.115
Last change on this file since 51c85da2 was a948e85d, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 09/22/08 at 11:30:51

Fixed wrong section size symbols.

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