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

4.104.114.84.95
Last change on this file since 9bffc2b6 was 9bffc2b6, checked in by Joel Sherrill <joel.sherrill@…>, on 11/05/04 at 14:44:12

2004-11-05 Joel Sherrill <joel@…>

  • startup/linkcmds: Add .gnu.linkonce.b and .gnu.linkonce.bs sections.
  • 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    *(.gnu.linkonce.sb.*)
205    PROVIDE (__sbss_end = .);
206  } > CODE
207  .plt   : { *(.plt) }  > CODE
208  .bss       :
209  {
210   PROVIDE (__bss_start = .);
211   *(.bss)
212   *(.dynbss)
213    *(.gnu.linkonce.b.*)
214   *(COMMON)
215  . = ALIGN(16);
216  } > CODE
217  . = ALIGN(16);
218  _end = . ;
219  __rtems_end = . ;
220  PROVIDE (end = .);
221  /DISCARD/ :
222  {
223    *(.comment)
224  }
225
226
227  /* Stabs debugging sections.  */
228  .stab 0 : { *(.stab) }
229  .stabstr 0 : { *(.stabstr) }
230  .stab.excl 0 : { *(.stab.excl) }
231  .stab.exclstr 0 : { *(.stab.exclstr) }
232  .stab.index 0 : { *(.stab.index) }
233  .stab.indexstr 0 : { *(.stab.indexstr) }
234  .comment 0 : { *(.comment) }
235
236  /* DWARF debug sections.
237     Symbols in the DWARF debugging sections are relative to the beginning
238     of the section so we begin them at 0.  */
239  /* DWARF 1 */
240  .debug          0 : { *(.debug) }
241  .line           0 : { *(.line) }
242 
243  /* GNU DWARF 1 extensions */
244  .debug_srcinfo  0 : { *(.debug_srcinfo) }
245  .debug_sfnames  0 : { *(.debug_sfnames) }
246 
247  /* DWARF 1.1 and DWARF 2 */
248  .debug_aranges  0 : { *(.debug_aranges) }
249  .debug_pubnames 0 : { *(.debug_pubnames) }
250 
251  /* DWARF 2 */
252  .debug_info     0 : { *(.debug_info) }
253  .debug_abbrev   0 : { *(.debug_abbrev) }
254  .debug_line     0 : { *(.debug_line) }
255  .debug_frame    0 : { *(.debug_frame) }
256  .debug_str      0 : { *(.debug_str) }
257  .debug_loc      0 : { *(.debug_loc) }
258  .debug_macinfo  0 : { *(.debug_macinfo) }
259 
260  /* SGI/MIPS DWARF 2 extensions */
261  .debug_weaknames 0 : { *(.debug_weaknames) }
262  .debug_funcnames 0 : { *(.debug_funcnames) }
263  .debug_typenames 0 : { *(.debug_typenames) }
264  .debug_varnames  0 : { *(.debug_varnames) }
265  /* These must appear regardless of  .  */
266}
Note: See TracBrowser for help on using the repository browser.