source: rtems/c/src/lib/libbsp/powerpc/motorola_powerpc/startup/linkcmds @ fad4a52b

4.104.114.84.95
Last change on this file since fad4a52b was fad4a52b, checked in by Joel Sherrill <joel.sherrill@…>, on 01/03/03 at 16:49:28

2002-12-08 Greg Menke <gregory.menke@…>

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