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

4.104.114.84.95
Last change on this file since 9c1133e was 9c1133e, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 20, 2003 at 7:57:14 PM

mkChangeLogList [-n]

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