source: rtems/c/src/lib/libbsp/powerpc/tqm8xx/startup/linkcmds.base @ 960fd85

4.115
Last change on this file since 960fd85 was 960fd85, checked in by Sebastian Huber <sebastian.huber@…>, on 01/28/14 at 10:52:17

bsps: Thread-local storage (TLS) for linkcmds

  • Property mode set to 100644
File size: 7.9 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        .tdata : {
117                _TLS_Data_begin = .;
118                *(.tdata .tdata.* .gnu.linkonce.td.*)
119                _TLS_Data_end = .;
120        } > RAM
121
122        .tbss : {
123                _TLS_BSS_begin = .;
124                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
125                _TLS_BSS_end = .;
126        } > RAM
127
128        _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
129        _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
130        _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
131        _TLS_Alignment = ALIGNOF (.tdata);
132
133        .sdata2 : {
134                PROVIDE (_SDA2_BASE_ = 32768);
135
136                *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
137
138                . = ALIGN (bsp_section_align);
139        } > RAM
140
141        .sbss2 : {
142                *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
143
144                . = ALIGN (bsp_section_align);
145
146                /*
147                 * BSP: End and size of text section
148                 */
149                bsp_section_text_end = .;
150                bsp_section_text_size = bsp_section_text_end - bsp_section_text_start;
151        } > RAM
152
153        .data : {
154                /*
155                 * BSP: Start of data section
156                 */
157                bsp_section_data_start = .;
158
159                /*
160                 * BSP: Moved into .data from .ctors
161                 */
162                /* gcc uses crtbegin.o to find the start of
163                   the constructors, so we make sure it is
164                   first.  Because this is a wildcard, it
165                   doesn't matter if the user does not
166                   actually link against crtbegin.o; the
167                   linker won't look for a file to match a
168                   wildcard.  The wildcard also means that it
169                   doesn't matter which directory crtbegin.o
170                   is in.  */
171                KEEP (*crtbegin.o(.ctors))
172                KEEP (*crtbegin?.o(.ctors))
173                /* We don't want to include the .ctor section from
174                   the crtend.o file until after the sorted ctors.
175                   The .ctor section from the crtend file contains the
176                   end of ctors marker and it must be last */
177                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
178                KEEP (*(SORT(.ctors.*)))
179                KEEP (*(.ctors))
180
181                /*
182                 * BSP: Moved into .data from .dtors
183                 */
184                KEEP (*crtbegin.o(.dtors))
185                KEEP (*crtbegin?.o(.dtors))
186                KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
187                KEEP (*(SORT(.dtors.*)))
188                KEEP (*(.dtors))
189
190                /*
191                 * BSP: Moved into .data from .*
192                 */
193                *(.tdata .tdata.* .gnu.linkonce.td.*)
194                *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
195                *(.data1)
196                KEEP (*(.eh_frame))
197                *(.gcc_except_table .gcc_except_table.*)
198                KEEP (*(.jcr))
199                *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*)
200                *(.fixup)
201                *(.got1)
202                *(.got2)
203                *(.dynamic)
204                *(.got)
205                *(.plt)
206                PROVIDE_HIDDEN (__preinit_array_start = .);
207                KEEP (*(.preinit_array))
208                PROVIDE_HIDDEN (__preinit_array_end = .);
209                PROVIDE_HIDDEN (__init_array_start = .);
210                KEEP (*(SORT(.init_array.*)))
211                KEEP (*(.init_array))
212                PROVIDE_HIDDEN (__init_array_end = .);
213                PROVIDE_HIDDEN (__fini_array_start = .);
214                KEEP (*(.fini_array))
215                KEEP (*(SORT(.fini_array.*)))
216                PROVIDE_HIDDEN (__fini_array_end = .);
217
218                *(.data .data.* .gnu.linkonce.d.*)
219                KEEP (*(.gnu.linkonce.d.*personality*))
220                SORT(CONSTRUCTORS)
221
222                . = ALIGN (bsp_section_align);
223        } > RAM
224
225        .sdata : {
226                PROVIDE (_SDA_BASE_ = 32768);
227                *(.sdata .sdata.* .gnu.linkonce.s.*)
228
229                . = ALIGN (bsp_section_align);
230
231                _edata = .;
232                PROVIDE (edata = .);
233
234                /*
235                 * BSP: End and size of data section
236                 */
237                bsp_section_data_end = .;
238                bsp_section_data_size = bsp_section_data_end - bsp_section_data_start;
239        } > RAM
240
241        .sbss : {
242                /*
243                 * BSP: Start of bss section
244                 */
245                bsp_section_bss_start = .;
246
247                __bss_start = .;
248
249                PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
250                *(.scommon)
251                *(.dynsbss)
252                *(.sbss .sbss.* .gnu.linkonce.sb.*)
253                PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
254
255                . = ALIGN (bsp_section_align);
256        } > RAM
257
258        .bss : {
259                *(COMMON)
260                *(.dynbss)
261                *(.bss .bss.* .gnu.linkonce.b.*)
262
263                . = ALIGN (bsp_section_align);
264
265                __end = .;
266                _end = .;
267                PROVIDE (end = .);
268
269                /*
270                 * BSP: End and size of bss section
271                 */
272                bsp_section_bss_end = .;
273                bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_start;
274        } > RAM
275
276        /*
277         * BSP: Interrupt stack
278         */
279        bsp_interrupt_stack_start = .;
280        bsp_interrupt_stack_end = bsp_interrupt_stack_start + 32k;
281        bsp_interrupt_stack_size = bsp_interrupt_stack_end - bsp_interrupt_stack_start;
282        . = bsp_interrupt_stack_end;
283
284        /*
285         * BSP: Work area start
286         */
287        bsp_work_area_start = .;
288       
289        /* Stabs debugging sections.  */
290        .stab          0 : { *(.stab) }
291        .stabstr       0 : { *(.stabstr) }
292        .stab.excl     0 : { *(.stab.excl) }
293        .stab.exclstr  0 : { *(.stab.exclstr) }
294        .stab.index    0 : { *(.stab.index) }
295        .stab.indexstr 0 : { *(.stab.indexstr) }
296        .comment       0 : { *(.comment) }
297        /* DWARF debug sections.
298           Symbols in the DWARF debugging sections are relative to the beginning
299           of the section so we begin them at 0.  */
300        /* DWARF 1 */
301        .debug          0 : { *(.debug) }
302        .line           0 : { *(.line) }
303        /* GNU DWARF 1 extensions */
304        .debug_srcinfo  0 : { *(.debug_srcinfo) }
305        .debug_sfnames  0 : { *(.debug_sfnames) }
306        /* DWARF 1.1 and DWARF 2 */
307        .debug_aranges  0 : { *(.debug_aranges) }
308        .debug_pubnames 0 : { *(.debug_pubnames) }
309        /* DWARF 2 */
310        .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
311        .debug_abbrev   0 : { *(.debug_abbrev) }
312        .debug_line     0 : { *(.debug_line) }
313        .debug_frame    0 : { *(.debug_frame) }
314        .debug_str      0 : { *(.debug_str) }
315        .debug_loc      0 : { *(.debug_loc) }
316        .debug_macinfo  0 : { *(.debug_macinfo) }
317        /* SGI/MIPS DWARF 2 extensions */
318        .debug_weaknames 0 : { *(.debug_weaknames) }
319        .debug_funcnames 0 : { *(.debug_funcnames) }
320        .debug_typenames 0 : { *(.debug_typenames) }
321        .debug_varnames  0 : { *(.debug_varnames) }
322        /* DWARF 3 */
323        .debug_pubtypes 0 : { *(.debug_pubtypes) }
324        .debug_ranges   0 : { *(.debug_ranges) }
325        /* DWARF extension */
326        .debug_macro    0 : { *(.debug_macro) }
327        .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
328
329        /DISCARD/ : {
330                *(.note.GNU-stack) *(.gnu_debuglink)
331        }
332       
333        /*
334         * This is a RTEMS specific section to catch all unexpected input
335         * sections.  In case you get an error like
336         *   "section `.unexpected_sections' will not fit in region
337         *   `UNEXPECTED_SECTIONS'"
338         * you have to figure out the offending input section and add it to the
339         * appropriate output section definition above.
340         */
341        .unexpected_sections : { *(*) } > UNEXPECTED_SECTIONS
342}
Note: See TracBrowser for help on using the repository browser.