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

4.104.114.84.95
Last change on this file since 84f0cfb was 84f0cfb, checked in by Ralf Corsepius <ralf.corsepius@…>, on Dec 9, 2003 at 2:52:20 PM

2003-12-09 Ralf Corsepius <corsepiu@…>

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