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

5
Last change on this file since b618d8c was b618d8c, checked in by Sebastian Huber <sebastian.huber@…>, on 09/16/15 at 05:13:58

Add RTEMS linker sets

Update #2408.

  • Property mode set to 100644
File size: 8.8 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*) KEEP (*(SORT(.rtemsroset.*))) *(.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_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
110  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
111  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
112  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
113  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
114  .sdata2         : { PROVIDE (_SDA2_BASE_ = 32768); *(.sdata2) *(.gnu.linkonce.s2.*)  }        > CODE
115  .sbss2          : {
116                                PROVIDE (__sbss2_start = .);
117                                          *(.sbss2*) *(.gnu.linkonce.sb2.*)
118                                          /* avoid empty sdata2/sbss2 area because __eabi wouldn't set up r2
119                                           * (IMPORTANT if run-time loading is involved)
120                                           */
121                                          . += 1 ;
122                                PROVIDE (__sbss2_end = .);
123                                        }       > CODE
124  .eh_frame           : { *.(eh_frame)          } >CODE
125  _etext = .;
126  PROVIDE (etext = .);
127  /* Adjust the address for the data segment.  We want to adjust up to
128     the same address within the page on the next page up.  It would
129     be more correct to do this:
130       . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
131     The current expression does not correctly handle the case of a
132     text segment ending precisely at the end of a page; it causes the
133     data segment to skip a page.  The above expression does not have
134     this problem, but it will currently (2/95) cause BFD to allocate
135     a single segment, combining both text and data, for this case.
136     This will prevent the text segment from being shared among
137     multiple executions of the program; I think that is more
138     important than losing a page of the virtual address space (note
139     that no actual memory is lost; the page which is skipped can not
140     be referenced).  */
141 .data  ALIGN(0x1000)  :
142  {
143        PROVIDE(__DATA_START__ = ABSOLUTE(.) );
144    *(.data)
145    KEEP (*(SORT(.rtemsrwset.*)))
146    *(.gnu.linkonce.d*)
147    CONSTRUCTORS
148  } > CODE
149  .data1   : { *(.data1) }      > CODE
150  PROVIDE (__EXCEPT_START__ = .);
151  .gcc_except_table   : { *(.gcc_except_table) } > CODE
152  PROVIDE (__EXCEPT_END__ = .);
153  .got1           : { *(.got1) }        > CODE
154  .dynamic        : { *(.dynamic) }     > CODE
155  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
156     get relocated with -mrelocatable. Also put in the .fixup pointers.
157     The current compiler no longer needs this, but keep it around for 2.7.2  */
158                PROVIDE (_GOT2_START_ = .);
159  .got2           :  { *(.got2) }       > CODE
160/*
161                PROVIDE (__CTOR_LIST__ = .);
162  .ctors          : { *(.ctors) }       > CODE
163                PROVIDE (__CTOR_END__ = .);
164*/
165  .ctors :
166  {
167    KEEP(*crtbegin.o(.ctors))
168    KEEP(*(EXCLUDE_FILE(*crtend.o) .ctors))
169    KEEP(*(SORT(.ctors.*)))
170    KEEP(*(.ctors))
171  } > CODE
172  .dtors :
173  {
174    KEEP(*crtbegin.o(.dtors))
175    KEEP(*(EXCLUDE_FILE(*crtend.o) .dtors))
176    KEEP(*(SORT(.dtors.*)))
177    KEEP(*(.dtors))
178  } > CODE
179/*
180                PROVIDE (__DTOR_LIST__ = .);
181  .dtors          : { *(.dtors) }       > CODE
182                PROVIDE (__DTOR_END__ = .);
183*/
184                PROVIDE (_FIXUP_START_ = .);
185  .fixup          : { *(.fixup) }       > CODE
186                PROVIDE (_FIXUP_END_ = .);
187                PROVIDE (_GOT2_END_ = .);
188                PROVIDE (_GOT_START_ = .);
189  .got            : { *(.got) } > CODE
190  .got.plt        : { *(.got.plt) }     > CODE
191                PROVIDE (_GOT_END_ = .);
192
193  .jcr            : { KEEP (*(.jcr)) } > CODE
194
195  /* We want the small data sections together, so single-instruction offsets
196     can access them all, and initialized data all before uninitialized, so
197     we can shorten the on-disk segment size.  */
198  .sdata          : { PROVIDE (_SDA_BASE_ = 32768); *(.sdata*) *(.gnu.linkonce.s.*) }   > CODE
199  _edata  =  .;
200  PROVIDE (edata = .);
201/* END OF THE LOADED IMAGE (parts moved by the preloader) */
202/* BELOW THIS POINT, NO LOADABLE ITEMS MUST APPEAR */
203  .sbss      :
204  {
205    PROVIDE (__sbss_start = ABSOLUTE(.));
206    *(.sbss) *(.sbss.*) *(.gnu.linkonce.sb.*)
207    *(.scommon)
208    *(.dynsbss)
209        /* avoid empty sdata/sbss area because __eabi wouldn't set up r13
210         * (IMPORTANT if run-time loading is involved)
211         */
212        . += 1 ;
213    PROVIDE (__sbss_end = ABSOLUTE(.));
214  } > CODE
215  .plt   : { *(.plt) }  > CODE
216  .bss       :
217  {
218   PROVIDE (__bss_start = ABSOLUTE(.));
219   *(.dynbss)
220   *(.bss*) *(.gnu.linkonce.b.*)
221   *(COMMON)
222  . = ALIGN(16);
223  } > CODE
224  /* proper alignment for SYSV stack
225   * (init stack is allocated just after __rtems_end
226   */
227  . = ALIGN(16);
228  _end = . ;
229  __rtems_end = . ;
230  PROVIDE (end = .);
231  /DISCARD/ :
232  {
233    *(.comment)
234  }
235
236
237  /* Stabs debugging sections.  */
238  .stab 0 : { *(.stab) }
239  .stabstr 0 : { *(.stabstr) }
240  .stab.excl 0 : { *(.stab.excl) }
241  .stab.exclstr 0 : { *(.stab.exclstr) }
242  .stab.index 0 : { *(.stab.index) }
243  .stab.indexstr 0 : { *(.stab.indexstr) }
244  .comment 0 : { *(.comment) }
245
246  /* DWARF debug sections.
247     Symbols in the DWARF debugging sections are relative to the beginning
248     of the section so we begin them at 0.  */
249  /* DWARF 1 */
250  .debug          0 : { *(.debug) }
251  .line           0 : { *(.line) }
252 
253  /* GNU DWARF 1 extensions */
254  .debug_srcinfo  0 : { *(.debug_srcinfo) }
255  .debug_sfnames  0 : { *(.debug_sfnames) }
256 
257  /* DWARF 1.1 and DWARF 2 */
258  .debug_aranges  0 : { *(.debug_aranges) }
259  .debug_pubnames 0 : { *(.debug_pubnames) }
260 
261  /* DWARF 2 */
262  .debug_info     0 : { *(.debug_info) }
263  .debug_abbrev   0 : { *(.debug_abbrev) }
264  .debug_line     0 : { *(.debug_line) }
265  .debug_frame    0 : { *(.debug_frame) }
266  .debug_str      0 : { *(.debug_str) }
267  .debug_loc      0 : { *(.debug_loc) }
268  .debug_macinfo  0 : { *(.debug_macinfo) }
269 
270  /* SGI/MIPS DWARF 2 extensions */
271  .debug_weaknames 0 : { *(.debug_weaknames) }
272  .debug_funcnames 0 : { *(.debug_funcnames) }
273  .debug_typenames 0 : { *(.debug_typenames) }
274  .debug_varnames  0 : { *(.debug_varnames) }
275  /* These must appear regardless of  .  */
276}
Note: See TracBrowser for help on using the repository browser.