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

4.104.114.84.95
Last change on this file since 8f814761 was 8f814761, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 20, 2003 at 9:57:59 PM

2003-02-20 Till Straumann <strauman@…>

PR 349/bsps

  • startup/Makefile.am, startup/linkcmds startup/Makefile.am, startup/bspstart.c, startup/pgtbl_activate.c, startup/pgtbl_setup.c: Let the powerpc/shared (+derived) BSPs use pagetable support from libcpu.
  • Property mode set to 100644
File size: 8.5 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           : { _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  .sdata2         : { *(.sdata2) *(.gnu.linkonce.s2.*)  } >CODE
101  .sbss2          : { *(.sbss2) *(.gnu.linkonce.sb2.*)  } >CODE
102  .eh_frame       : { *.(eh_frame)              } >CODE
103
104  /* NOTE: if the BSP uses page tables, the correctness of
105   *       '_etext' (and __DATA_START__) is CRUCIAL - otherwise,
106   *       an invalid mapping may result!!!
107   */
108  _etext = .;
109  PROVIDE (etext = .);
110
111  /* Adjust the address for the data segment.  We want to adjust up to
112     the same address within the page on the next page up.  It would
113     be more correct to do this:
114       . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
115     The current expression does not correctly handle the case of a
116     text segment ending precisely at the end of a page; it causes the
117     data segment to skip a page.  The above expression does not have
118     this problem, but it will currently (2/95) cause BFD to allocate
119     a single segment, combining both text and data, for this case.
120     This will prevent the text segment from being shared among
121     multiple executions of the program; I think that is more
122     important than losing a page of the virtual address space (note
123     that no actual memory is lost; the page which is skipped can not
124     be referenced).  */
125  . = ALIGN(0x1000);
126 .data ALIGN(0x1000) :
127  {
128   /* NOTE: if the BSP uses page tables, the correctness of
129    *       '__DATA_START__' (and _etext) is CRUCIAL - otherwise,
130    *       an invalid mapping may result!!!
131    */
132        PROVIDE(__DATA_START__ = ABSOLUTE(.) );
133    *(.data)
134    *(.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  .sdata          : { *(.sdata) *(.gnu.linkonce.s.*)    } >CODE
195  _edata  =  .;
196  PROVIDE (edata = .);
197  .sbss      :
198  {
199    PROVIDE (__sbss_start = .);
200    *(.sbss)
201    *(.scommon)
202    *(.dynsbss)
203    PROVIDE (__sbss_end = .);
204  } > CODE
205  .plt   : { *(.plt) }  > CODE
206  .bss       :
207  {
208   PROVIDE (__bss_start = .);
209   *(.dynbss)
210   *(.bss)
211   *(COMMON)
212  . = ALIGN(16);
213  } > CODE
214  . = ALIGN(16);
215  _end = . ;
216  __rtems_end = . ;
217  PROVIDE (end = .);
218  /DISCARD/ :
219  {
220    *(.comment)
221  }
222
223
224  /* Stabs debugging sections.  */
225  .stab 0 : { *(.stab) }
226  .stabstr 0 : { *(.stabstr) }
227  .stab.excl 0 : { *(.stab.excl) }
228  .stab.exclstr 0 : { *(.stab.exclstr) }
229  .stab.index 0 : { *(.stab.index) }
230  .stab.indexstr 0 : { *(.stab.indexstr) }
231  .comment 0 : { *(.comment) }
232
233  /* DWARF debug sections.
234     Symbols in the DWARF debugging sections are relative to the beginning
235     of the section so we begin them at 0.  */
236  /* DWARF 1 */
237  .debug          0 : { *(.debug) }
238  .line           0 : { *(.line) }
239 
240  /* GNU DWARF 1 extensions */
241  .debug_srcinfo  0 : { *(.debug_srcinfo) }
242  .debug_sfnames  0 : { *(.debug_sfnames) }
243 
244  /* DWARF 1.1 and DWARF 2 */
245  .debug_aranges  0 : { *(.debug_aranges) }
246  .debug_pubnames 0 : { *(.debug_pubnames) }
247 
248  /* DWARF 2 */
249  .debug_info     0 : { *(.debug_info) }
250  .debug_abbrev   0 : { *(.debug_abbrev) }
251  .debug_line     0 : { *(.debug_line) }
252  .debug_frame    0 : { *(.debug_frame) }
253  .debug_str      0 : { *(.debug_str) }
254  .debug_loc      0 : { *(.debug_loc) }
255  .debug_macinfo  0 : { *(.debug_macinfo) }
256 
257  /* SGI/MIPS DWARF 2 extensions */
258  .debug_weaknames 0 : { *(.debug_weaknames) }
259  .debug_funcnames 0 : { *(.debug_funcnames) }
260  .debug_typenames 0 : { *(.debug_typenames) }
261  .debug_varnames  0 : { *(.debug_varnames) }
262  /* These must appear regardless of  .  */
263}
Note: See TracBrowser for help on using the repository browser.