source: rtems/c/src/lib/libbsp/powerpc/tqm8xx/startup/linkcmds.tqm8xx_base @ 6494f7d

5
Last change on this file since 6494f7d was 375e923d, checked in by Sebastian Huber <sebastian.huber@…>, on 01/03/18 at 08:08:59

bsps/powerpc: Rename BSP specific linkcmds.base

Avoid name conflicts with shared linkcmds.base.

Update #3254.

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