source: rtems/c/src/lib/libbsp/lm32/milkymist/startup/linkcmds @ dce1032b

4.115
Last change on this file since dce1032b was dce1032b, checked in by Joel Sherrill <joel.sherrill@…>, on 08/01/11 at 13:48:40

2011-08-01 Sebastien Bourdeauducq <sebastien.bourdeauducq@…>

PR 1869/bsps

  • startup/bspclean.c: New file.
  • include/tm27.h: Removed.
  • ChangeLog?, Makefile.am, README, preinstall.am, include/bsp.h, include/system_conf.h, make/custom/milkymist.cfg, startup/linkcmds: Complete BSP for Milkymist One supporting Milkymist SOC 1.0.x. Includes new or updated drivers for:
    • Multi-standard video input (PAL/SECAM/NTSC)
    • Two DMX512 (RS485) ports
    • MIDI IN and MIDI OUT ports
    • VGA output
    • AC'97 audio
    • NOR flash
    • 10/100 Ethernet
    • Memory card (experimental and incomplete)
    • USB host connectors (input devices only)
    • RC5 infrared receiver
    • RS232 debug port
  • Property mode set to 100644
File size: 9.3 KB
Line 
1OUTPUT_FORMAT("elf32-lm32", "elf32-lm32",
2              "elf32-lm32")
3OUTPUT_ARCH(lm32)
4ENTRY(_start)
5/* Do we need any of these for elf?
6   __DYNAMIC = 0;    */
7
8/*
9 * Declare some sizes. Heap is sized at whatever ram space is left.
10 */
11RamBase = DEFINED(RamBase) ? RamBase : 0x40000000;
12RamSize = DEFINED(RamSize) ? RamSize : 128M;
13HeapSize = DEFINED(HeapSize) ? HeapSize : 92M;
14_StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000;
15
16PROVIDE (__stack = 0);
17MEMORY {
18        sdram   : ORIGIN = 0x40000000 , LENGTH = 128M
19}
20SECTIONS
21{
22  .boot :
23  {
24    KEEP (*(.boot))
25  } > sdram
26
27  /* Read-only sections, merged into text segment: */
28  .interp   : { *(.interp) }    > sdram
29  .hash           : { *(.hash)          }       > sdram
30  .dynsym         : { *(.dynsym)                }       > sdram
31  .dynstr         : { *(.dynstr)                }       > sdram
32  .gnu.version   : { *(.gnu.version)      }     > sdram
33  .gnu.version_d   : { *(.gnu.version_d)  }     > sdram
34  .gnu.version_r   : { *(.gnu.version_r)  }     > sdram
35  .rela.text     :
36    { *(.rela.text) *(.rela.gnu.linkonce.t*) }  > sdram
37  .rela.data     :
38    { *(.rela.data) *(.rela.gnu.linkonce.d*) }  > sdram
39  .rela.rodata   :
40    { *(.rela.rodata*) *(.rela.gnu.linkonce.r*) }       > sdram
41  .rela.got       : { *(.rela.got)      }       > sdram
42  .rela.got1      : { *(.rela.got1)     }       > sdram
43  .rela.got2      : { *(.rela.got2)     }       > sdram
44  .rela.ctors     : { *(.rela.ctors)    }       > sdram
45  .rela.dtors     : { *(.rela.dtors)    }       > sdram
46  .rela.init      : { *(.rela.init)     }       > sdram
47  .rela.fini      : { *(.rela.fini)     }       > sdram
48  .rela.bss       : { *(.rela.bss)      }       > sdram
49  .rela.plt       : { *(.rela.plt)      }       > sdram
50  .rela.sdata     : { *(.rela.sdata)    }       > sdram
51  .rela.sbss      : { *(.rela.sbss)     }       > sdram
52  .rela.sdata2    : { *(.rela.sdata2)   }       > sdram
53  .rela.sbss2     : { *(.rela.sbss2)    }       > sdram
54  .rela.dyn       : { *(.rela.dyn)      }       > sdram
55
56  .init           : { KEEP(*(.init))            } > sdram
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  }  > sdram
76
77  .fini           : { _fini = .; KEEP(*(.fini)) } > sdram
78
79  .rodata         : { *(.rodata*) *(.gnu.linkonce.r*) } > sdram
80  .rodata1        : { *(.rodata1) }     > sdram
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) } >sdram
92  PROVIDE (__preinit_array_end = .);
93  PROVIDE (__init_array_start = .);
94  .init_array     : { *(.init_array) } >sdram
95  PROVIDE (__init_array_end = .);
96  PROVIDE (__fini_array_start = .);
97  .fini_array     : { *(.fini_array) } >sdram
98  PROVIDE (__fini_array_end = .);
99
100/* _SDA2_BASE_ = __SDATA2_START__ + 0xe000; */
101  .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } >sdram
102  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
103                        /* avoid empty sdata2/sbss2 area -- __eabi would not set up r2
104                         * which may be important if run-time loading is used
105                         */
106                     . += 1;
107                    } >sdram
108  .eh_frame       : { *.(eh_frame)              } >sdram
109
110  /* NOTE: if the BSP uses page tables, the correctness of
111   *       '_etext' (and __DATA_START__) is CRUCIAL - otherwise,
112   *       an invalid mapping may result!!!
113   */
114  _etext = .;
115  PROVIDE (etext = .);
116
117  /* Adjust the address for the data segment.  We want to adjust up to
118     the same address within the page on the next page up.  It would
119     be more correct to do this:
120       . = ALIGN(0x40000) + (ALIGN(8) & (0x40000 - 1));
121     The current expression does not correctly handle the case of a
122     text segment ending precisely at the end of a page; it causes the
123     data segment to skip a page.  The above expression does not have
124     this problem, but it will currently (2/95) cause BFD to allocate
125     a single segment, combining both text and data, for this case.
126     This will prevent the text segment from being shared among
127     multiple executions of the program; I think that is more
128     important than losing a page of the virtual address space (note
129     that no actual memory is lost; the page which is skipped can not
130     be referenced).  */
131  . = ALIGN(0x1000);
132 .data ALIGN(0x1000) :
133  {
134   /* NOTE: if the BSP uses page tables, the correctness of
135    *       '__DATA_START__' (and _etext) is CRUCIAL - otherwise,
136    *       an invalid mapping may result!!!
137    */
138        PROVIDE(__DATA_START__ = ABSOLUTE(.) );
139    *(.data .data.* .gnu.linkonce.d*)   
140    SORT(CONSTRUCTORS)
141  } > sdram
142  .data1   : { *(.data1) }      > sdram
143  PROVIDE (__EXCEPT_START__ = .);
144  .gcc_except_table   : {
145    *(.gcc_except_table)
146    *(.gcc_except_table.*)
147  } > sdram
148  PROVIDE (__EXCEPT_END__ = .);
149  .got1           : { *(.got1) }        > sdram
150  /* Put .ctors and .dtors next to the .got2 section, so that the pointers
151     get relocated with -mrelocatable. Also put in the .fixup pointers.
152     The current compiler no longer needs this, but keep it around for 2.7.2  */
153                PROVIDE (_GOT2_START_ = .);
154  .got2           :  { *(.got2) }       > sdram
155  .dynamic        : { *(.dynamic) }     > sdram
156
157  .ctors          :
158  {
159    /* gcc uses crtbegin.o to find the start of
160       the constructors, so we make sure it is
161       first.  Because this is a wildcard, it
162       doesn't matter if the user does not
163       actually link against crtbegin.o; the
164       linker won't look for a file to match a
165       wildcard.  The wildcard also means that it
166       doesn't matter which directory crtbegin.o
167       is in.  */
168    KEEP (*crtbegin.o(.ctors))
169    /* We don't want to include the .ctor section from
170       from the crtend.o file until after the sorted ctors.
171       The .ctor section from the crtend file contains the
172       end of ctors marker and it must be last */
173    KEEP (*(EXCLUDE_FILE (*crtend.o ) .ctors))
174    KEEP (*(SORT(.ctors.*)))
175    KEEP (*(.ctors))
176  } > sdram
177  .dtors          :
178  {
179    KEEP (*crtbegin.o(.dtors))
180    KEEP (*(EXCLUDE_FILE (*crtend.o ) .dtors))
181    KEEP (*(SORT(.dtors.*)))
182    KEEP (*(.dtors))
183  } > sdram
184
185
186                PROVIDE (_FIXUP_START_ = .);
187  .fixup          : { *(.fixup) }       > sdram
188                PROVIDE (_FIXUP_END_ = .);
189                PROVIDE (_GOT2_END_ = .);
190                PROVIDE (_GOT_START_ = .);
191
192  .got            : { *(.got) } > sdram
193  .got.plt        : { *(.got.plt) }     > sdram
194
195                PROVIDE (_GOT_END_ = .);
196
197  .jcr            : { KEEP (*(.jcr)) } > sdram
198
199  /* We want the small data sections together, so single-instruction offsets
200     can access them all, and initialized data all before uninitialized, so
201     we can shorten the on-disk segment size.  */
202/* _SDA_BASE_ = __SDATA_START__ + 0xe000; */
203  .sdata          : { *(.sdata*) *(.gnu.linkonce.s.*)   } >sdram
204  _edata  =  .;
205  _gp = .;
206  PROVIDE (edata = .);
207  .sbss      :
208  {
209    _clear_start = .;
210    PROVIDE (__sbss_start = .);
211    *(.dynsbss)
212    *(.sbss* .gnu.linkonce.sb.*)
213    *(.scommon)
214    /* avoid empty sdata/sbss area -- __eabi would not set up r13
215     * which may be important if run-time loading is used
216     */
217    . += 1;
218    . = ALIGN(16);
219    PROVIDE (__sbss_end = .);
220  } > sdram
221  .plt   : { *(.plt) }  > sdram
222  .bss       :
223  {
224   PROVIDE (__bss_start = .);
225   *(.dynbss)
226   *(.bss .bss* .gnu.linkonce.b*)
227   *(COMMON)
228  . = ALIGN(16);
229  _end = . ;
230  __rtems_end = . ;
231  PROVIDE (end = .);
232
233  . += _StackSize;
234  _fstack = .;
235
236  WorkAreaBase = .;
237
238    . = ALIGN (16);
239    _stack_init = .;
240    _clear_end = .;
241
242  } > sdram
243
244
245  /DISCARD/ :
246  {
247    *(.comment)
248  }
249
250
251  /* Stabs debugging sections.  */
252  .stab 0 : { *(.stab) }
253  .stabstr 0 : { *(.stabstr) }
254  .stab.excl 0 : { *(.stab.excl) }
255  .stab.exclstr 0 : { *(.stab.exclstr) }
256  .stab.index 0 : { *(.stab.index) }
257  .stab.indexstr 0 : { *(.stab.indexstr) }
258  .comment 0 : { *(.comment) }
259
260  /* DWARF debug sections.
261     Symbols in the DWARF debugging sections are relative to the beginning
262     of the section so we begin them at 0.  */
263  /* DWARF 1 */
264  .debug          0 : { *(.debug) }
265  .line           0 : { *(.line) }
266 
267  /* GNU DWARF 1 extensions */
268  .debug_srcinfo  0 : { *(.debug_srcinfo) }
269  .debug_sfnames  0 : { *(.debug_sfnames) }
270 
271  /* DWARF 1.1 and DWARF 2 */
272  .debug_aranges  0 : { *(.debug_aranges) }
273  .debug_pubnames 0 : { *(.debug_pubnames) }
274 
275  /* DWARF 2 */
276  .debug_info     0 : { *(.debug_info) }
277  .debug_abbrev   0 : { *(.debug_abbrev) }
278  .debug_line     0 : { *(.debug_line) }
279  .debug_frame    0 : { *(.debug_frame) }
280  .debug_str      0 : { *(.debug_str) }
281  .debug_loc      0 : { *(.debug_loc) }
282  .debug_macinfo  0 : { *(.debug_macinfo) }
283 
284  /* SGI/MIPS DWARF 2 extensions */
285  .debug_weaknames 0 : { *(.debug_weaknames) }
286  .debug_funcnames 0 : { *(.debug_funcnames) }
287  .debug_typenames 0 : { *(.debug_typenames) }
288  .debug_varnames  0 : { *(.debug_varnames) }
289  /* These must appear regardless of  .  */
290}
Note: See TracBrowser for help on using the repository browser.