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

4.104.114.95
Last change on this file since d4886a06 was d4886a06, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 07/24/08 at 14:52:55

Changed bsp_get_workarea() to bsp_get_work_area() and
added support for an optional separate heap area.

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