source: rtems/c/src/lib/libbsp/powerpc/virtex4/startup/linkcmds @ 5b822ab

4.115
Last change on this file since 5b822ab was 5b822ab, checked in by Ric Claus <claus@…>, on 11/30/12 at 23:56:04

Virtex4 BSP: Various updates and improvements.

Switched to using the PPC403 clock driver. Added support for the MMU but
didn't enable it by default. Made some functions static to avoid compiler
warnings. Added a README.

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