source: rtems/c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds @ 8e980e61

4.115
Last change on this file since 8e980e61 was 8e980e61, checked in by Sebastian Huber <sebastian.huber@…>, on 04/01/14 at 07:48:40

bsps/powerpc: Fix linker command files

  • Property mode set to 100644
File size: 8.5 KB
Line 
1OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
2              "elf32-powerpc")
3OUTPUT_ARCH(powerpc)
4ENTRY(_start)
5/* Do we need any of these for elf?
6   __DYNAMIC = 0;    */
7PROVIDE (__stack = 0);
8
9
10MEMORY {
11    BOTTOM  : ORIGIN = 0x00,    LENGTH = 0x80
12    MAILBOX : ORIGIN = 0x80,    LENGTH = 0x80   /* RESERVED */
13        VECTORS : ORIGIN = 0x100 ,  LENGTH = 0x3000 - 0x100
14        CODE : ORIGIN = 0x3000 , LENGTH = 32M-0x3000
15}
16SECTIONS
17{
18  /* discard the 'shared/vector.S' entry point section */
19  /DISCARD/ :
20  {
21        *(.entry_point_section)
22  }
23
24
25  .vectors :
26  {
27        /* should be the first thing... */
28        *(.ppc_preloader_section)
29
30   /*
31    * This section is used only if NO_DYNAMIC_EXCEPTION_VECTOR_INSTALL
32    * is defined in vectors/vectors.S
33    *  *(.vectors)
34    * We actually RELY on dynamic vector installation since we need
35    * this space for the preloader...
36    */
37  } > VECTORS
38
39
40  /* START OF THE LOADED IMAGE (parts moved by the preloader) */
41  .image_start :
42  {
43        __rtems_start = ABSOLUTE(.);
44  } > CODE
45
46  /* Read-only sections, merged into text segment: */
47  .interp   : { *(.interp) }    > CODE
48  .hash           : { *(.hash)          }       > CODE
49  .dynsym         : { *(.dynsym)                }       > CODE
50  .dynstr         : { *(.dynstr)                }       > CODE
51  .gnu.version   : { *(.gnu.version)      }     > CODE
52  .gnu.version_d   : { *(.gnu.version_d)  }     > CODE
53  .gnu.version_r   : { *(.gnu.version_r)  }     > CODE
54  .rela.text     :
55    { *(.rela.text) *(.rela.gnu.linkonce.t*) }  > CODE
56  .rela.data     :
57    { *(.rela.data) *(.rela.gnu.linkonce.d*) }  > CODE
58  .rela.rodata   :
59    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }        > CODE
60  .rela.got       : { *(.rela.got)      }       > CODE
61  .rela.got1      : { *(.rela.got1)     }       > CODE
62  .rela.got2      : { *(.rela.got2)     }       > CODE
63  .rela.ctors     : { *(.rela.ctors)    }       > CODE
64  .rela.dtors     : { *(.rela.dtors)    }       > CODE
65  .rela.init      : { *(.rela.init)     }       > CODE
66  .rela.fini      : { *(.rela.fini)     }       > CODE
67  .rela.bss       : { *(.rela.bss)      }       > CODE
68  .rela.plt       : { *(.rela.plt)      }       > CODE
69  .rela.sdata     : { *(.rela.sdata)    }       > CODE
70  .rela.sbss      : { *(.rela.sbss)     }       > CODE
71  .rela.sdata2    : { *(.rela.sdata2)   }       > CODE
72  .rela.sbss2     : { *(.rela.sbss2)    }       > CODE
73
74  .init                   : { *(.init)                  } >CODE
75
76  .text      : 
77  {
78    *(.text*)   
79 
80    /*
81     * Special FreeBSD sysctl sections.
82     */
83    . = ALIGN (16);
84    __start_set_sysctl_set = .;
85    *(set_sysctl_*);
86    __stop_set_sysctl_set = ABSOLUTE(.);
87    *(set_domain_*);
88    *(set_pseudo_*);
89 
90   /* .gnu.warning sections are handled specially by elf32.em.  */
91    *(.gnu.warning)
92    *(.gnu.linkonce.t*)
93  }  > CODE
94
95  .fini                   : { _fini = .; *(.fini)       } >CODE
96  .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) } > CODE
97  .rodata1        : { *(.rodata1) }     > CODE
98  .tdata : {
99    _TLS_Data_begin = .;
100    *(.tdata .tdata.* .gnu.linkonce.td.*)
101    _TLS_Data_end = .;
102  } >CODE
103  .tbss : {
104    _TLS_BSS_begin = .;
105    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
106    _TLS_BSS_end = .;
107  } >CODE
108  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
109  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
110  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
111  _TLS_Alignment = ALIGNOF (.tdata);
112  .sdata2         : { PROVIDE (_SDA2_BASE_ = 32768); *(.sdata2) *(.gnu.linkonce.s2.*)  }        > CODE
113  .sbss2          : {
114                                PROVIDE (__sbss2_start = .);
115                                          *(.sbss2*) *(.gnu.linkonce.sb2.*)
116                                          /* avoid empty sdata2/sbss2 area because __eabi wouldn't set up r2
117                                           * (IMPORTANT if run-time loading is involved)
118                                           */
119                                          . += 1 ;
120                                PROVIDE (__sbss2_end = .);
121                                        }       > CODE
122  .eh_frame           : { *.(eh_frame)          } >CODE
123  _etext = .;
124  PROVIDE (etext = .);
125  /* Adjust the address for the data segment.  We want to adjust up to
126     the same address within the page on the next page up.  It would
127     be more correct to do this:
128       . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
129     The current expression does not correctly handle the case of a
130     text segment ending precisely at the end of a page; it causes the
131     data segment to skip a page.  The above expression does not have
132     this problem, but it will currently (2/95) cause BFD to allocate
133     a single segment, combining both text and data, for this case.
134     This will prevent the text segment from being shared among
135     multiple executions of the program; I think that is more
136     important than losing a page of the virtual address space (note
137     that no actual memory is lost; the page which is skipped can not
138     be referenced).  */
139 .data  ALIGN(0x1000)  :
140  {
141        PROVIDE(__DATA_START__ = ABSOLUTE(.) );
142    *(.data)
143    *(.gnu.linkonce.d*)
144    CONSTRUCTORS
145  } > CODE
146  .data1   : { *(.data1) }      > CODE
147  PROVIDE (__EXCEPT_START__ = .);
148  .gcc_except_table   : { *(.gcc_except_table) } > CODE
149  PROVIDE (__EXCEPT_END__ = .);
150  .got1           : { *(.got1) }        > CODE
151  .dynamic        : { *(.dynamic) }     > CODE
152  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
153     get relocated with -mrelocatable. Also put in the .fixup pointers.
154     The current compiler no longer needs this, but keep it around for 2.7.2  */
155                PROVIDE (_GOT2_START_ = .);
156  .got2           :  { *(.got2) }       > CODE
157/*
158                PROVIDE (__CTOR_LIST__ = .);
159  .ctors          : { *(.ctors) }       > CODE
160                PROVIDE (__CTOR_END__ = .);
161*/
162  .ctors :
163  {
164    KEEP(*crtbegin.o(.ctors))
165    KEEP(*(EXCLUDE_FILE(*crtend.o) .ctors))
166    KEEP(*(SORT(.ctors.*)))
167    KEEP(*(.ctors))
168  } > CODE
169  .dtors :
170  {
171    KEEP(*crtbegin.o(.dtors))
172    KEEP(*(EXCLUDE_FILE(*crtend.o) .dtors))
173    KEEP(*(SORT(.dtors.*)))
174    KEEP(*(.dtors))
175  } > CODE
176/*
177                PROVIDE (__DTOR_LIST__ = .);
178  .dtors          : { *(.dtors) }       > CODE
179                PROVIDE (__DTOR_END__ = .);
180*/
181                PROVIDE (_FIXUP_START_ = .);
182  .fixup          : { *(.fixup) }       > CODE
183                PROVIDE (_FIXUP_END_ = .);
184                PROVIDE (_GOT2_END_ = .);
185                PROVIDE (_GOT_START_ = .);
186  .got            : { *(.got) } > CODE
187  .got.plt        : { *(.got.plt) }     > CODE
188                PROVIDE (_GOT_END_ = .);
189
190  .jcr            : { KEEP (*(.jcr)) } > CODE
191
192  /* We want the small data sections together, so single-instruction offsets
193     can access them all, and initialized data all before uninitialized, so
194     we can shorten the on-disk segment size.  */
195  .sdata          : { PROVIDE (_SDA_BASE_ = 32768); *(.sdata*) *(.gnu.linkonce.s.*) }   > CODE
196  _edata  =  .;
197  PROVIDE (edata = .);
198/* END OF THE LOADED IMAGE (parts moved by the preloader) */
199/* BELOW THIS POINT, NO LOADABLE ITEMS MUST APPEAR */
200  .sbss      :
201  {
202    PROVIDE (__sbss_start = ABSOLUTE(.));
203    *(.sbss) *(.sbss.*) *(.gnu.linkonce.sb.*)
204    *(.scommon)
205    *(.dynsbss)
206        /* avoid empty sdata/sbss area because __eabi wouldn't set up r13
207         * (IMPORTANT if run-time loading is involved)
208         */
209        . += 1 ;
210    PROVIDE (__sbss_end = ABSOLUTE(.));
211  } > CODE
212  .plt   : { *(.plt) }  > CODE
213  .bss       :
214  {
215   PROVIDE (__bss_start = ABSOLUTE(.));
216   *(.dynbss)
217   *(.bss*) *(.gnu.linkonce.b.*)
218   *(COMMON)
219  . = ALIGN(16);
220  } > CODE
221  /* proper alignment for SYSV stack
222   * (init stack is allocated just after __rtems_end
223   */
224  . = ALIGN(16);
225  _end = . ;
226  __rtems_end = . ;
227  PROVIDE (end = .);
228  /DISCARD/ :
229  {
230    *(.comment)
231  }
232
233
234  /* Stabs debugging sections.  */
235  .stab 0 : { *(.stab) }
236  .stabstr 0 : { *(.stabstr) }
237  .stab.excl 0 : { *(.stab.excl) }
238  .stab.exclstr 0 : { *(.stab.exclstr) }
239  .stab.index 0 : { *(.stab.index) }
240  .stab.indexstr 0 : { *(.stab.indexstr) }
241  .comment 0 : { *(.comment) }
242
243  /* DWARF debug sections.
244     Symbols in the DWARF debugging sections are relative to the beginning
245     of the section so we begin them at 0.  */
246  /* DWARF 1 */
247  .debug          0 : { *(.debug) }
248  .line           0 : { *(.line) }
249 
250  /* GNU DWARF 1 extensions */
251  .debug_srcinfo  0 : { *(.debug_srcinfo) }
252  .debug_sfnames  0 : { *(.debug_sfnames) }
253 
254  /* DWARF 1.1 and DWARF 2 */
255  .debug_aranges  0 : { *(.debug_aranges) }
256  .debug_pubnames 0 : { *(.debug_pubnames) }
257 
258  /* DWARF 2 */
259  .debug_info     0 : { *(.debug_info) }
260  .debug_abbrev   0 : { *(.debug_abbrev) }
261  .debug_line     0 : { *(.debug_line) }
262  .debug_frame    0 : { *(.debug_frame) }
263  .debug_str      0 : { *(.debug_str) }
264  .debug_loc      0 : { *(.debug_loc) }
265  .debug_macinfo  0 : { *(.debug_macinfo) }
266 
267  /* SGI/MIPS DWARF 2 extensions */
268  .debug_weaknames 0 : { *(.debug_weaknames) }
269  .debug_funcnames 0 : { *(.debug_funcnames) }
270  .debug_typenames 0 : { *(.debug_typenames) }
271  .debug_varnames  0 : { *(.debug_varnames) }
272  /* These must appear regardless of  .  */
273}
Note: See TracBrowser for help on using the repository browser.