source: rtems/bsps/powerpc/shared/start/linkcmds.share @ 84e59b7c

Last change on this file since 84e59b7c was 84e59b7c, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 15, 2018 at 7:47:22 PM

bsps/powerpc: Use interrupt stack for init stack

Move start.o to separate file.

Update #3459.

  • Property mode set to 100644
File size: 9.8 KB
Line 
1OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
2              "elf32-powerpc")
3OUTPUT_ARCH(powerpc)
4/* Do we need any of these for elf?
5   __DYNAMIC = 0;    */
6MEMORY {
7        VECTORS : ORIGIN = 0x0 ,  LENGTH = 0x3000
8        CODE : ORIGIN = 0x3000 , LENGTH = 32M - 0x3000
9}
10SECTIONS
11{
12  .entry_point_section :
13  {
14        KEEP(*(.entry_point_section))
15  } > VECTORS
16
17  /*
18   * This section is used only if NO_DYNAMIC_EXCEPTION_VECTOR_INSTALL
19   * is defined in vectors/vectors.S
20   */
21  .vectors :
22  {
23    *(.vectors)
24  } > VECTORS
25
26  /* Read-only sections, merged into text segment: */
27  .interp   : { *(.interp) }    > CODE
28  .hash           : { *(.hash)          }       > CODE
29  .dynsym         : { *(.dynsym)                }       > CODE
30  .dynstr         : { *(.dynstr)                }       > CODE
31  .gnu.version   : { *(.gnu.version)      }     > CODE
32  .gnu.version_d   : { *(.gnu.version_d)  }     > CODE
33  .gnu.version_r   : { *(.gnu.version_r)  }     > CODE
34  .rela.text     :
35    { *(.rela.text) *(.rela.gnu.linkonce.t*) }  > CODE
36  .rela.data     :
37    { *(.rela.data) *(.rela.gnu.linkonce.d*) }  > CODE
38  .rela.rodata   :
39    { *(.rela.rodata*) *(.rela.gnu.linkonce.r*) }       > CODE
40  .rela.got       : { *(.rela.got)      }       > CODE
41  .rela.got1      : { *(.rela.got1)     }       > CODE
42  .rela.got2      : { *(.rela.got2)     }       > CODE
43  .rela.ctors     : { *(.rela.ctors)    }       > CODE
44  .rela.dtors     : { *(.rela.dtors)    }       > CODE
45  .rela.init      : { *(.rela.init)     }       > CODE
46  .rela.fini      : { *(.rela.fini)     }       > CODE
47  .rela.bss       : { *(.rela.bss)      }       > CODE
48  .rela.plt       : { *(.rela.plt)      }       > CODE
49  .rela.sdata     : { *(.rela.sdata)    }       > CODE
50  .rela.sbss      : { *(.rela.sbss)     }       > CODE
51  .rela.sdata2    : { *(.rela.sdata2)   }       > CODE
52  .rela.sbss2     : { *(.rela.sbss2)    }       > CODE
53  .rela.dyn       : { *(.rela.dyn)      }       > CODE
54
55  .init           : { KEEP(*(.init))            } > CODE
56
57  .text      : 
58  {
59    *(.text*)   
60
61    /*
62     * Special FreeBSD sysctl sections.
63     */
64    . = ALIGN (16);
65    __start_set_sysctl_set = .;
66    *(set_sysctl_*);
67    __stop_set_sysctl_set = ABSOLUTE(.);
68    *(set_domain_*);
69    *(set_pseudo_*);
70
71    /* .gnu.warning sections are handled specially by elf32.em.  */
72    *(.gnu.warning)
73    *(.gnu.linkonce.t*)
74  }  > CODE
75
76  .fini           : { _fini = .; KEEP(*(.fini)) } > CODE
77
78  .rodata         : { *(.rodata*) KEEP (*(SORT(.rtemsroset.*))) *(.gnu.linkonce.r*) }   > CODE
79  .rodata1        : { *(.rodata1) }     > CODE
80
81  .tdata : {
82    _TLS_Data_begin = .;
83    *(.tdata .tdata.* .gnu.linkonce.td.*)
84    _TLS_Data_end = .;
85  } >CODE
86
87  .tbss : {
88    _TLS_BSS_begin = .;
89    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
90    _TLS_BSS_end = .;
91  } >CODE
92
93  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
94  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
95  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
96  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
97  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
98  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
99
100  .rtemsstack (NOLOAD) : {
101    *(SORT(.rtemsstack.*))
102  } >CODE
103
104  /* Adjust the address for the data segment.  We want to adjust up to
105     the same address within the page on the next page up.  */
106  . = ALIGN(0x10000) + (. & (0x10000 - 1));
107  /* Ensure the __preinit_array_start label is properly aligned.  We
108     could instead move the label definition inside the section, but
109     the linker would then create the section even if it turns out to
110     be empty, which isn't pretty.  */
111  . = ALIGN(32 / 8);
112  PROVIDE (__preinit_array_start = .);
113  .preinit_array     : { *(.preinit_array) } >CODE
114  PROVIDE (__preinit_array_end = .);
115  PROVIDE (__init_array_start = .);
116  .init_array     : { *(.init_array) } >CODE
117  PROVIDE (__init_array_end = .);
118  PROVIDE (__fini_array_start = .);
119  .fini_array     : { *(.fini_array) } >CODE
120  PROVIDE (__fini_array_end = .);
121
122  .sdata2         : {PROVIDE (_SDA2_BASE_ = 32768); *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } >CODE
123  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
124                        /* avoid empty sdata2/sbss2 area -- __eabi would not set up r2
125                         * which may be important if run-time loading is used
126                         */
127                     . += 1;
128                     PROVIDE (__SBSS2_END__ = .);
129                    } >CODE
130  .eh_frame       : { *(.eh_frame)              } >CODE
131
132  /* NOTE: if the BSP uses page tables, the correctness of
133   *       '_etext' (and __DATA_START__) is CRUCIAL - otherwise,
134   *       an invalid mapping may result!!!
135   */
136  _etext = .;
137  PROVIDE (etext = .);
138
139  /* Adjust the address for the data segment.  We want to adjust up to
140     the same address within the page on the next page up.  It would
141     be more correct to do this:
142       . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
143     The current expression does not correctly handle the case of a
144     text segment ending precisely at the end of a page; it causes the
145     data segment to skip a page.  The above expression does not have
146     this problem, but it will currently (2/95) cause BFD to allocate
147     a single segment, combining both text and data, for this case.
148     This will prevent the text segment from being shared among
149     multiple executions of the program; I think that is more
150     important than losing a page of the virtual address space (note
151     that no actual memory is lost; the page which is skipped can not
152     be referenced).  */
153  . = ALIGN(0x1000);
154 .data ALIGN(0x1000) :
155  {
156   /* NOTE: if the BSP uses page tables, the correctness of
157    *       '__DATA_START__' (and _etext) is CRUCIAL - otherwise,
158    *       an invalid mapping may result!!!
159    */
160        PROVIDE(__DATA_START__ = ABSOLUTE(.) );
161    *(.data .data.* .gnu.linkonce.d*)   
162    KEEP (*(SORT(.rtemsrwset.*)))
163    SORT(CONSTRUCTORS)
164  } > CODE
165  .data1   : { *(.data1) }      > CODE
166  PROVIDE (__EXCEPT_START__ = .);
167  .gcc_except_table   : { *(.gcc_except_table*) } > CODE
168  PROVIDE (__EXCEPT_END__ = .);
169  .got1           : { *(.got1) }        > CODE
170  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
171     get relocated with -mrelocatable. Also put in the .fixup pointers.
172     The current compiler no longer needs this, but keep it around for 2.7.2  */
173                PROVIDE (_GOT2_START_ = .);
174  .got2           :  { *(.got2) }       > CODE
175  .dynamic        : { *(.dynamic) }     > CODE
176
177  .ctors          :
178  {
179    /* gcc uses crtbegin.o to find the start of
180       the constructors, so we make sure it is
181       first.  Because this is a wildcard, it
182       doesn't matter if the user does not
183       actually link against crtbegin.o; the
184       linker won't look for a file to match a
185       wildcard.  The wildcard also means that it
186       doesn't matter which directory crtbegin.o
187       is in.  */
188    KEEP (*crtbegin.o(.ctors))
189    /* We don't want to include the .ctor section from
190       from the crtend.o file until after the sorted ctors.
191       The .ctor section from the crtend file contains the
192       end of ctors marker and it must be last */
193    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
194    KEEP (*(SORT(.ctors.*)))
195    KEEP (*(.ctors))
196  } > CODE
197  .dtors          :
198  {
199    KEEP (*crtbegin.o(.dtors))
200    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
201    KEEP (*(SORT(.dtors.*)))
202    KEEP (*(.dtors))
203  } > CODE
204
205
206                PROVIDE (_FIXUP_START_ = .);
207  .fixup          : { *(.fixup) }       > CODE
208                PROVIDE (_FIXUP_END_ = .);
209                PROVIDE (_GOT2_END_ = .);
210                PROVIDE (_GOT_START_ = .);
211
212  .got            : { *(.got) } > CODE
213  .got.plt        : { *(.got.plt) }     > CODE
214
215                PROVIDE (_GOT_END_ = .);
216
217  .jcr            : { KEEP (*(.jcr)) } > CODE
218
219  /* We want the small data sections together, so single-instruction offsets
220     can access them all, and initialized data all before uninitialized, so
221     we can shorten the on-disk segment size.  */
222  .sdata          : { PROVIDE (_SDA_BASE_ = 32768); *(.sdata*) *(.gnu.linkonce.s.*)     } >CODE
223  _edata  =  .;
224  PROVIDE (edata = .);
225  .sbss      :
226  {
227    PROVIDE (__sbss_start = .);
228    *(.dynsbss)
229    *(.sbss* .gnu.linkonce.sb.*)
230    *(.scommon)
231    /* avoid empty sdata/sbss area -- __eabi would not set up r13
232     * which may be important if run-time loading is used
233     */
234    . += 1;
235    PROVIDE (__SBSS_END__ = .);
236    PROVIDE (__sbss_end = .);
237  } > CODE
238  .plt   : { *(.plt) }  > CODE
239  .bss       :
240  {
241   PROVIDE (__bss_start = .);
242   *(.dynbss)
243   *(.bss .bss* .gnu.linkonce.b*)
244   *(COMMON)
245  . = ALIGN(16);
246   PROVIDE (__bss_end = .);
247  } > CODE
248  . = ALIGN(16);
249  _end = . ;
250  __rtems_end = . ;
251  PROVIDE (end = .);
252  /DISCARD/ :
253  {
254    *(.comment)
255  }
256
257
258  /* Stabs debugging sections.  */
259  .stab 0 : { *(.stab) }
260  .stabstr 0 : { *(.stabstr) }
261  .stab.excl 0 : { *(.stab.excl) }
262  .stab.exclstr 0 : { *(.stab.exclstr) }
263  .stab.index 0 : { *(.stab.index) }
264  .stab.indexstr 0 : { *(.stab.indexstr) }
265  .comment 0 : { *(.comment) }
266
267  /* DWARF debug sections.
268     Symbols in the DWARF debugging sections are relative to the beginning
269     of the section so we begin them at 0.  */
270  /* DWARF 1 */
271  .debug          0 : { *(.debug) }
272  .line           0 : { *(.line) }
273 
274  /* GNU DWARF 1 extensions */
275  .debug_srcinfo  0 : { *(.debug_srcinfo) }
276  .debug_sfnames  0 : { *(.debug_sfnames) }
277 
278  /* DWARF 1.1 and DWARF 2 */
279  .debug_aranges  0 : { *(.debug_aranges) }
280  .debug_pubnames 0 : { *(.debug_pubnames) }
281 
282  /* DWARF 2 */
283  .debug_info     0 : { *(.debug_info) }
284  .debug_abbrev   0 : { *(.debug_abbrev) }
285  .debug_line     0 : { *(.debug_line) }
286  .debug_frame    0 : { *(.debug_frame) }
287  .debug_str      0 : { *(.debug_str) }
288  .debug_loc      0 : { *(.debug_loc) }
289  .debug_macinfo  0 : { *(.debug_macinfo) }
290 
291  /* SGI/MIPS DWARF 2 extensions */
292  .debug_weaknames 0 : { *(.debug_weaknames) }
293  .debug_funcnames 0 : { *(.debug_funcnames) }
294  .debug_typenames 0 : { *(.debug_typenames) }
295  .debug_varnames  0 : { *(.debug_varnames) }
296  /* These must appear regardless of  .  */
297}
Note: See TracBrowser for help on using the repository browser.