source: rtems/c/src/lib/libbsp/powerpc/beatnik/startup/linkcmds @ 6273201

4.115
Last change on this file since 6273201 was b7a6d23a, checked in by Till Straumann <strauman@…>, on 12/03/09 at 16:56:50
  • importing 'beatnik' BSP from SLAC repository.
  • 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);
8
9
10MEMORY {
11    BOTTOM  : ORIGIN = 0x00,    LENGTH = 0x80
12    MAILBOX : ORIGIN = 0x80,    LENGTH = 0x80   /* RESERVED */
13        VECTORS : ORIGIN = 0x100 ,  LENGTH = 0x3000 - 0x100
14        CODE : ORIGIN = 0x3000 , LENGTH = 32M-0x3000
15}
16SECTIONS
17{
18  /* discard the 'shared/vector.S' entry point section */
19  /DISCARD/ :
20  {
21        *(.entry_point_section)
22  }
23
24
25  .vectors :
26  {
27        /* should be the first thing... */
28        *(.ppc_preloader_section)
29
30   /*
31    * This section is used only if NO_DYNAMIC_EXCEPTION_VECTOR_INSTALL
32    * is defined in vectors/vectors.S
33    *  *(.vectors)
34    * We actually RELY on dynamic vector installation since we need
35    * this space for the preloader...
36    */
37  } > VECTORS
38
39
40  /* START OF THE LOADED IMAGE (parts moved by the preloader) */
41  .image_start :
42  {
43        __rtems_start = ABSOLUTE(.);
44  } > CODE
45
46  /* Read-only sections, merged into text segment: */
47  .interp   : { *(.interp) }    > CODE
48  .hash           : { *(.hash)          }       > CODE
49  .dynsym         : { *(.dynsym)                }       > CODE
50  .dynstr         : { *(.dynstr)                }       > CODE
51  .gnu.version   : { *(.gnu.version)      }     > CODE
52  .gnu.version_d   : { *(.gnu.version_d)  }     > CODE
53  .gnu.version_r   : { *(.gnu.version_r)  }     > CODE
54  .rela.text     :
55    { *(.rela.text) *(.rela.gnu.linkonce.t*) }  > CODE
56  .rela.data     :
57    { *(.rela.data) *(.rela.gnu.linkonce.d*) }  > CODE
58  .rela.rodata   :
59    { *(.rela.rodata) *(.rela.gnu.linkonce.r*) }        > CODE
60  .rela.got       : { *(.rela.got)      }       > CODE
61  .rela.got1      : { *(.rela.got1)     }       > CODE
62  .rela.got2      : { *(.rela.got2)     }       > CODE
63  .rela.ctors     : { *(.rela.ctors)    }       > CODE
64  .rela.dtors     : { *(.rela.dtors)    }       > CODE
65  .rela.init      : { *(.rela.init)     }       > CODE
66  .rela.fini      : { *(.rela.fini)     }       > CODE
67  .rela.bss       : { *(.rela.bss)      }       > CODE
68  .rela.plt       : { *(.rela.plt)      }       > CODE
69  .rela.sdata     : { *(.rela.sdata)    }       > CODE
70  .rela.sbss      : { *(.rela.sbss)     }       > CODE
71  .rela.sdata2    : { *(.rela.sdata2)   }       > CODE
72  .rela.sbss2     : { *(.rela.sbss2)    }       > CODE
73
74  .init                   : { *(.init)                  } >CODE
75
76  .text      : 
77  {
78    *(.text*)   
79 
80    /*
81     * Special FreeBSD sysctl sections.
82     */
83    . = ALIGN (16);
84    __start_set_sysctl_set = .;
85    *(set_sysctl_*);
86    __stop_set_sysctl_set = ABSOLUTE(.);
87    *(set_domain_*);
88    *(set_pseudo_*);
89 
90   /* .gnu.warning sections are handled specially by elf32.em.  */
91    *(.gnu.warning)
92    *(.gnu.linkonce.t*)
93  }  > CODE
94
95  .fini                   : { _fini = .; *(.fini)       } >CODE
96  .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) } > CODE
97  .rodata1        : { *(.rodata1) }     > CODE
98_SDA2_BASE_ = __SDATA2_START__ + 0x8000;
99  .sdata2         : { *(.sdata2) *(.gnu.linkonce.s2.*)  }       > CODE
100  .sbss2          : {
101                                PROVIDE (__sbss2_start = .);
102                                          *(.sbss2*) *(.gnu.linkonce.sb2.*)
103                                          /* avoid empty sdata2/sbss2 area because __eabi wouldn't set up r2
104                                           * (IMPORTANT if run-time loading is involved)
105                                           */
106                                          . += 1 ;
107                                PROVIDE (__sbss2_end = .);
108                                        }       > CODE
109  .eh_frame           : { *.(eh_frame)          } >CODE
110  _etext = .;
111  PROVIDE (etext = .);
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 .data  ALIGN(0x1000)  :
127  {
128        PROVIDE(__DATA_START__ = ABSOLUTE(.) );
129    *(.data)
130    *(.gnu.linkonce.d*)
131    CONSTRUCTORS
132  } > CODE
133  .data1   : { *(.data1) }      > CODE
134  PROVIDE (__EXCEPT_START__ = .);
135  .gcc_except_table   : { *(.gcc_except_table) } > CODE
136  PROVIDE (__EXCEPT_END__ = .);
137  .got1           : { *(.got1) }        > CODE
138  .dynamic        : { *(.dynamic) }     > CODE
139  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
140     get relocated with -mrelocatable. Also put in the .fixup pointers.
141     The current compiler no longer needs this, but keep it around for 2.7.2  */
142                PROVIDE (_GOT2_START_ = .);
143  .got2           :  { *(.got2) }       > CODE
144/*
145                PROVIDE (__CTOR_LIST__ = .);
146  .ctors          : { *(.ctors) }       > CODE
147                PROVIDE (__CTOR_END__ = .);
148*/
149  .ctors :
150  {
151    KEEP(*crtbegin.o(.ctors))
152    KEEP(*(EXCLUDE_FILE(*crtend.o) .ctors))
153    KEEP(*(SORT(.ctors.*)))
154    KEEP(*(.ctors))
155  } > CODE
156  .dtors :
157  {
158    KEEP(*crtbegin.o(.dtors))
159    KEEP(*(EXCLUDE_FILE(*crtend.o) .dtors))
160    KEEP(*(SORT(.dtors.*)))
161    KEEP(*(.dtors))
162  } > CODE
163/*
164                PROVIDE (__DTOR_LIST__ = .);
165  .dtors          : { *(.dtors) }       > CODE
166                PROVIDE (__DTOR_END__ = .);
167*/
168                PROVIDE (_FIXUP_START_ = .);
169  .fixup          : { *(.fixup) }       > CODE
170                PROVIDE (_FIXUP_END_ = .);
171                PROVIDE (_GOT2_END_ = .);
172                PROVIDE (_GOT_START_ = .);
173  .got            : { *(.got) } > CODE
174  .got.plt        : { *(.got.plt) }     > CODE
175                PROVIDE (_GOT_END_ = .);
176
177  .jcr            : { KEEP (*(.jcr)) } > CODE
178
179  /* We want the small data sections together, so single-instruction offsets
180     can access them all, and initialized data all before uninitialized, so
181     we can shorten the on-disk segment size.  */
182_SDA_BASE_ = __SDATA_START__ + 0x8000;
183  .sdata          : { *(.sdata*) *(.gnu.linkonce.s.*) } > CODE
184  _edata  =  .;
185  PROVIDE (edata = .);
186/* END OF THE LOADED IMAGE (parts moved by the preloader) */
187/* BELOW THIS POINT, NO LOADABLE ITEMS MUST APPEAR */
188  .sbss      :
189  {
190    PROVIDE (__sbss_start = ABSOLUTE(.));
191    *(.sbss) *(.sbss.*) *(.gnu.linkonce.sb.*)
192    *(.scommon)
193    *(.dynsbss)
194        /* avoid empty sdata/sbss area because __eabi wouldn't set up r13
195         * (IMPORTANT if run-time loading is involved)
196         */
197        . += 1 ;
198    PROVIDE (__sbss_end = ABSOLUTE(.));
199  } > CODE
200  .plt   : { *(.plt) }  > CODE
201  .bss       :
202  {
203   PROVIDE (__bss_start = ABSOLUTE(.));
204   *(.dynbss)
205   *(.bss*) *(.gnu.linkonce.b.*)
206   *(COMMON)
207  . = ALIGN(16);
208  } > CODE
209  /* proper alignment for SYSV stack
210   * (init stack is allocated just after __rtems_end
211   */
212  . = ALIGN(16);
213  _end = . ;
214  __rtems_end = . ;
215  PROVIDE (end = .);
216  /DISCARD/ :
217  {
218    *(.comment)
219  }
220
221
222  /* Stabs debugging sections.  */
223  .stab 0 : { *(.stab) }
224  .stabstr 0 : { *(.stabstr) }
225  .stab.excl 0 : { *(.stab.excl) }
226  .stab.exclstr 0 : { *(.stab.exclstr) }
227  .stab.index 0 : { *(.stab.index) }
228  .stab.indexstr 0 : { *(.stab.indexstr) }
229  .comment 0 : { *(.comment) }
230
231  /* DWARF debug sections.
232     Symbols in the DWARF debugging sections are relative to the beginning
233     of the section so we begin them at 0.  */
234  /* DWARF 1 */
235  .debug          0 : { *(.debug) }
236  .line           0 : { *(.line) }
237 
238  /* GNU DWARF 1 extensions */
239  .debug_srcinfo  0 : { *(.debug_srcinfo) }
240  .debug_sfnames  0 : { *(.debug_sfnames) }
241 
242  /* DWARF 1.1 and DWARF 2 */
243  .debug_aranges  0 : { *(.debug_aranges) }
244  .debug_pubnames 0 : { *(.debug_pubnames) }
245 
246  /* DWARF 2 */
247  .debug_info     0 : { *(.debug_info) }
248  .debug_abbrev   0 : { *(.debug_abbrev) }
249  .debug_line     0 : { *(.debug_line) }
250  .debug_frame    0 : { *(.debug_frame) }
251  .debug_str      0 : { *(.debug_str) }
252  .debug_loc      0 : { *(.debug_loc) }
253  .debug_macinfo  0 : { *(.debug_macinfo) }
254 
255  /* SGI/MIPS DWARF 2 extensions */
256  .debug_weaknames 0 : { *(.debug_weaknames) }
257  .debug_funcnames 0 : { *(.debug_funcnames) }
258  .debug_typenames 0 : { *(.debug_typenames) }
259  .debug_varnames  0 : { *(.debug_varnames) }
260  /* These must appear regardless of  .  */
261}
Note: See TracBrowser for help on using the repository browser.