source: rtems/bsps/powerpc/virtex4/start/linkcmds @ 84e59b7c

5
Last change on this file since 84e59b7c was 84e59b7c, checked in by Sebastian Huber <sebastian.huber@…>, on 11/15/18 at 19:47:22

bsps/powerpc: Use interrupt stack for init stack

Move start.o to separate file.

Update #3459.

  • Property mode set to 100644
File size: 10.7 KB
RevLine 
[16a8616]1/*
2 *  This file contains directives for the GNU linker which are specific to the
3 *  Virtex 4 PPC 405.  No assumptions are made on the firmware in the FPGA.
4 *  This file is intended to be used together with start.S to generate
5 *  downloadable code.
6 */
7
8OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
9OUTPUT_ARCH(powerpc)
10
[84e59b7c]11STARTUP(start.o)
[16a8616]12ENTRY(download_entry)
[b80d7355]13EXTERN(download_entry)
14EXTERN(__vectors)
[16a8616]15
16MsgAreaSize       = DEFINED(MsgAreaSize)   ? MsgAreaSize   : 1M;
17RamBase           = DEFINED(RamBase)       ? RamBase       : 0x0;
18RamSize           = DEFINED(RamSize)       ? RamSize       : 128M - MsgAreaSize;
19HeapSize          = DEFINED(HeapSize)      ? HeapSize      : 0; /* 0=Use def */
20
21
22MEMORY
23{
[5b822ab]24  VECTORS         : ORIGIN = 0x00000000, LENGTH = 12K
25  RAM             : ORIGIN = 0x00003000, LENGTH = 128M - 12K
[16a8616]26}
27
28
29SECTIONS
30{
[5b822ab]31  bsp_exc_vector_base = 0x100;
32  __exeentry          = download_entry;
33  __exestart          = bsp_exc_vector_base;
34  .vectors bsp_exc_vector_base : { *(.vectors)                  } > VECTORS
[16a8616]35
36  /* Read-only sections, merged into text segment: */
37  .interp         : { *(.interp)                                } > RAM
38  .hash           : { *(.hash)                                  } > RAM
39  .dynsym         : { *(.dynsym)                                } > RAM
40  .dynstr         : { *(.dynstr)                                } > RAM
41  .gnu.version    : { *(.gnu.version)                           } > RAM
42  .gnu.version_d  : { *(.gnu.version_d)                         } > RAM
43  .gnu.version_r  : { *(.gnu.version_r)                         } > RAM
44  .rela.text      : { *(.rela.text) *(.rela.gnu.linkonce.t*)    } > RAM
45  .rela.data      : { *(.rela.data) *(.rela.gnu.linkonce.d*)    } > RAM
46  .rela.rodata    : { *(.rela.rodata*) *(.rela.gnu.linkonce.r*) } > RAM
47  .rela.got       : { *(.rela.got)                              } > RAM
48  .rela.got1      : { *(.rela.got1)                             } > RAM
49  .rela.got2      : { *(.rela.got2)                             } > RAM
50  .rela.ctors     : { *(.rela.ctors)                            } > RAM
51  .rela.dtors     : { *(.rela.dtors)                            } > RAM
52  .rela.init      : { *(.rela.init)                             } > RAM
53  .rela.fini      : { *(.rela.fini)                             } > RAM
54  .rela.bss       : { *(.rela.bss)                              } > RAM
55  .rela.plt       : { *(.rela.plt)                              } > RAM
56  .rela.sdata     : { *(.rela.sdata)                            } > RAM
57  .rela.sbss      : { *(.rela.sbss)                             } > RAM
58  .rela.sdata2    : { *(.rela.sdata2)                           } > RAM
59  .rela.sbss2     : { *(.rela.sbss2)                            } > RAM
60  .rela.dyn       : { *(.rela.dyn)                              } > RAM
61
62  /* Initialization code */
63  .init           : { PROVIDE (_init = .);
64                      *ecrti.o(.init)
65                      KEEP(*(.init))
66                      *ecrtn.o(.init)
67                    } > RAM
68
69  .text           : { *(.entry)
70                      *(.text)
71                      *(.text.*)
72
73                      /* Special FreeBSD sysctl sections */
74                      . = ALIGN (16);
75                      __start_set_sysctl_set = .;
76                      *(set_sysctl_*);
77                      __stop_set_sysctl_set = ABSOLUTE(.);
78                      *(set_domain_*);
79                      *(set_pseudo_*);
80
81                      /* .gnu.warning sections are handled specially by elf32.em
82                       */
83                      *(.gnu.warning)
84                      *(.gnu.linkonce.t*)
85                    } > RAM
86
87  /* Finalization code */
88  .fini           : { PROVIDE (_fini = .);
89                      *ecrti.o(.fini)
90                      KEEP(*(.fini))
91                      *ecrtn.o(.fini)
92                    } > RAM
93
94  /* Miscellaneous read-only data */
[44d18b9]95  .rodata         : { *(.rodata.* .gnu.linkonce.r*) KEEP (*(SORT(.rtemsroset.*))) } > RAM
[16a8616]96  .rodata1        : { *(.rodata1)                                      } > RAM
97
[960fd85]98  .tdata : {
99    _TLS_Data_begin = .;
100    *(.tdata .tdata.* .gnu.linkonce.td.*)
101    _TLS_Data_end = .;
102  } >RAM
103
104  .tbss : {
105    _TLS_BSS_begin = .;
106    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
107    _TLS_BSS_end = .;
108  } >RAM
109
110  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
[d60e760]111  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
112  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
[960fd85]113  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
114  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
[d60e760]115  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
[960fd85]116
[16a8616]117  /* Initialised small data addressed as offsets from r2 */
[8e980e61]118  .sdata2         : { PROVIDE (_SDA2_BASE_ = 32768); *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)          } > RAM
[16a8616]119
120  /* Zeroed small data addressed as offsets from r2 */
121  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
122
123                      /* Avoid empty sdata2/sbss2 area: __eabi would not set up
124                       * r2 which may be important if run-time loading is used
125                       */
126                      . += 1;
127
128                      PROVIDE (__SBSS2_END__ = .);
129                    } > RAM
130
131  /* Exception frame info */
132  .eh_frame       : { *(.eh_frame .eh_frame.*)                         } > RAM
133  .eh_frame_hdr   : { *(.eh_frame_hdr)                                 } > RAM
134
135  /*  Declares where the .text section ends */
136  _etext          = .;
137  PROVIDE (etext  = .);
138
139  /* Initialized R/W Data section goes in RAM */
140  .data           : { PROVIDE(__DATA_START__ = ABSOLUTE(.) );
141                      *(.data)
142                      *(.data.*)
[b618d8c]143                      KEEP (*(SORT(.rtemsrwset.*)))
[16a8616]144                      *(.gnu.linkonce.d*)
145                    } > RAM
146
147  .data1          : { *(.data1)                                        } > RAM
148
149                        PROVIDE (__EXCEPT_START__ = .);
150  .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*)       } > RAM
151                        PROVIDE (__EXCEPT_END__ = .);
152
153  .got1           : { *(.got1)                                         } > RAM
154
155  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
156   * get relocated with -mrelocatable. Also put in the .fixup pointers.
157   * The current compiler no longer needs this, but keep it around for 2.7.2.
158   */
159                      PROVIDE (_GOT2_START_ = .);
160  .got2           : { *(.got2)                                         } > RAM
161
162  .dynamic        : { *(.dynamic)                                      } > RAM
163
164  .ctors          : { /* gcc uses crtbegin.o to find the start of
165                       * the constructors, so we make sure it is
166                       * first.  Because this is a wildcard, it
167                       * doesn't matter if the user does not
168                       * actually link against crtbegin.o; the
169                       * linker won't look for a file to match a
170                       * wildcard.  The wildcard also means that it
171                       * doesn't matter which directory crtbegin.o
172                       * is in.
173                       */
174                      KEEP (*crtbegin.o(.ctors))
175                      /* We don't want to include the .ctor section from
176                       * the crtend.o file until after the sorted ctors.
177                       * The .ctor section from the crtend file contains the
178                       * end of ctors marker and it must be last.
179                       */
180                      KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
181                      KEEP (*(SORT(.ctors.*)))
182                      KEEP (*(.ctors))
183                    } > RAM
184
185  .dtors          : { KEEP (*crtbegin.o(.dtors))
186                      KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
187                      KEEP (*(SORT(.dtors.*)))
188                      KEEP (*(.dtors))
189                    } > RAM
190
191                      PROVIDE (_FIXUP_START_ = .);
192  .fixup          : { *(.fixup)                                        } > RAM
193                      PROVIDE (_FIXUP_END_ = .);
194
195                      PROVIDE (_GOT2_END_ = .);
196
197                      PROVIDE (_GOT_START_ = .);
198  .got            : { __got_start = .;
199                      *(.got)
200                    } > RAM
201
202  .got.plt        : { *(.got.plt)                                      } > RAM
203                      PROVIDE (_GOT_END_ = .);
204
205  .jcr            : { KEEP (*(.jcr))                                   } > RAM
206
207  /* We want the small data sections together, so single-instruction offsets
208   * can access them all, and initialized data all before uninitialized, so
209   * we can shorten the on-disk segment size.
210   */
211  /* Initialised small data addressed as offsets from r13 */
[8e980e61]212  .sdata          : { PROVIDE (_SDA_BASE_ = 32768); *(.sdata* .gnu.linkonce.s.*)                     } > RAM
[16a8616]213
214  _edata          = .;
215  PROVIDE (edata  = .);
216
217  /* Zeroed small data addressed as offsets from r13 */
218  .sbss           : { PROVIDE (__sbss_start = .);
219                      *(.dynsbss)
220                      *(.sbss*)
221                      *(.gnu.linkonce.sb.*)
222                      *(.scommon)
223
224                      /* Avoid empty sdata/sbss area: __eabi would not set up
225                       * r13, which may be important if run-time loading is used
226                       */
227                      . += 1;
228
229                      PROVIDE (__SBSS_END__ = .);
230                      PROVIDE (__sbss_end   = .);
231                    } > RAM
232
233  .plt            : { *(.plt)                                          } > RAM
234  .iplt           : { *(.iplt)                                         } > RAM
235
236  /* Zeroed large data */
237  .bss            : { PROVIDE (__bss_start = .);
238                      *(.dynbss)
239                      *(.bss)
240                      *(.bss.*)
241                      *(.gnu.linkonce.b*)
242                      *(COMMON)
243
244                      PROVIDE (__bss_end = ALIGN(4));
245                      __bss_size = __bss_end - __bss_start;
246                    } > RAM
247
248  __exeend        = ALIGN(4);
249  __rtems_end     = .;
250  .               = ALIGN(0x10);        /* Align to a cache-line boundary */
251  PROVIDE(__bsp_ram_start = .);
252
[715d616]253  .rtemsstack (NOLOAD) : {
254    *(SORT(.rtemsstack.*))
255  } >RAM
256
257  WorkAreaBase = .;
[16a8616]258
259  /* The heap comes after the work space */
260
261   .              = RamBase + RamSize;
262  PROVIDE(__bsp_ram_end = .);
263
264  /* Message area for capturing early printk output */
265  /* Placed here to be easily findable with a debugger */
[5b822ab]266  MsgAreaBase     = .;
[16a8616]267  .              += MsgAreaSize;
268
269  __phy_ram_end   = .;                  /* True end of physical memory */
270
271  /DISCARD/ :
272  {
273    *(.comment)
274  }
275
276  /* Some configuration constants: Not clear why they're placed here */
277  __dccr          = 0x80000000;
278  __iccr          = 0x80000000;
279  __sgr           = 0x7fffffff;
280  __vectors       = 0;
281}
Note: See TracBrowser for help on using the repository browser.