source: rtems/c/src/lib/libbsp/sparc/leon2/startup/linkcmds @ 38386473

4.104.115
Last change on this file since 38386473 was 8b074ee6, checked in by Joel Sherrill <joel.sherrill@…>, on 03/25/09 at 17:56:04

2009-03-25 Joel Sherrill <joel.sherrill@…>

  • startup/linkcmds: Start of RTEMS Work Area must be on 16 byte boundary on the SPARC.
  • Property mode set to 100644
File size: 4.8 KB
Line 
1/*  linkcmds
2 *
3 *  $Id$
4 */
5
6OUTPUT_ARCH(sparc)
7__DYNAMIC  =  0;
8
9/*
10 * The memory map looks like this:
11 * +--------------------+ <- low memory
12 * | .text              |
13 * |        etext       |
14 * |        ctor list   | the ctor and dtor lists are for
15 * |        dtor list   | C++ support
16 * |        _endtext    |
17 * +--------------------+
18 * | .data              | initialized data goes here
19 * |        _sdata      |
20 * |        _edata      |
21 * +--------------------+
22 * | .bss               |
23 * |        __bss_start | start of bss, cleared by crt0
24 * |        _end        | start of heap, used by sbrk()
25 * +--------------------+
26 * |    heap space      |
27 * |        _ENDHEAP    |
28 * |    stack space     |
29 * |        __stack     | top of stack
30 * +--------------------+ <- high memory
31 */
32
33
34/*
35 * User modifiable values:
36 *
37 * _CLOCK_SPEED               in Mhz (used to program the counter/timers)
38 *
39 * _PROM_SIZE                 size of PROM (permissible values are 128K, 256K,
40 *                               512K, 1M, 2M, 4M, 8M and 16M)
41 * _RAM_SIZE                  size of RAM (permissible values are 256K, 512K,
42 *                               1M, 2M, 4M, 8M, 16M, and 32M)
43 *
44 */
45
46/* Default values, can be overridden */
47
48_PROM_SIZE = 2M;
49_RAM_SIZE = 4M;
50
51_RAM_START = 0x40000000;
52_RAM_END = _RAM_START + _RAM_SIZE;
53
54_PROM_START = 0x00000000;
55_PROM_END = _PROM_START + _PROM_SIZE;
56
57/*
58 *  Alternate names without leading _.
59 */
60
61PROM_START = _PROM_START;
62PROM_SIZE = _PROM_SIZE;
63PROM_END = _PROM_END;
64
65RAM_START = _RAM_START;
66RAM_SIZE = _RAM_SIZE;
67RAM_END = _RAM_END;
68
69/*
70 *  Base address of the on-CPU peripherals
71 */
72
73_LEON_REG = 0x80000000;
74LEON_REG = 0x80000000;
75
76/* these are the maximum values */
77
78MEMORY
79{
80  rom     : ORIGIN = 0x00000000, LENGTH = 256M
81  ram     : ORIGIN = 0x40000000, LENGTH = 1024M
82}
83
84/*
85 * SPARC monitor assumes this is present to provide proper RTEMS awareness.
86 */
87EXTERN(rtems_get_version_string);
88
89/*
90 * stick everything in ram (of course)
91 */
92SECTIONS
93{
94  .text :
95  {
96    CREATE_OBJECT_SYMBOLS
97    text_start = .;
98    _text_start = .;
99    *(.text*)
100    . = ALIGN (16);
101
102    /*
103     * Special FreeBSD sysctl sections.
104     */
105    . = ALIGN (16);
106    __start_set_sysctl_set = .;
107    *(set_sysctl_*);
108    __stop_set_sysctl_set = ABSOLUTE(.);
109    *(set_domain_*);
110    *(set_pseudo_*);
111
112    *(.eh_frame)
113    . = ALIGN (16);
114
115    *(.gnu.linkonce.t*)
116
117    /*
118     * C++ constructors
119     */
120    /* gcc uses crtbegin.o to find the start of
121       the constructors, so we make sure it is
122       first.  Because this is a wildcard, it
123       doesn't matter if the user does not
124       actually link against crtbegin.o; the
125       linker won't look for a file to match a
126       wildcard.  The wildcard also means that it
127       doesn't matter which directory crtbegin.o
128       is in.  */
129    KEEP (*crtbegin.o(.ctors))
130    KEEP (*crtbegin?.o(.ctors))
131    /* We don't want to include the .ctor section from
132       the crtend.o file until after the sorted ctors.
133       The .ctor section from the crtend file contains the
134       end of ctors marker and it must be last */
135    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
136    KEEP (*(SORT(.ctors.*)))
137    KEEP (*(.ctors))
138    KEEP (*crtbegin.o(.dtors))
139    KEEP (*crtbegin?.o(.dtors))
140    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
141    KEEP (*(SORT(.dtors.*)))
142    KEEP (*(.dtors))
143
144    _rodata_start = . ;
145    *(.rodata*)
146    *(.gnu.linkonce.r*)
147    _erodata = ALIGN( 0x10 ) ;
148
149    etext = ALIGN(0x10);
150    _etext = .;
151    *(.init)
152    *(.fini)
153    *(.lit)
154    *(.shdata)
155    . = ALIGN (16);
156    _endtext = .;
157  } > ram
158  .rela.dyn       :
159    {
160      *(.rela.init)
161      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
162      *(.rela.fini)
163      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
164      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
165      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
166      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
167      *(.rela.ctors)
168      *(.rela.dtors)
169      *(.rela.got)
170      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
171    } >ram
172  .data :
173  {
174    data_start = .;
175    _data_start = .;
176    _sdata = . ;
177    *(.data*)
178    *(.gnu.linkonce.d*)
179    *(.gcc_except_table*)
180    . = ALIGN(0x10);
181    edata = .;
182    _edata = .;
183  } > ram
184  .dynamic        : { *(.dynamic)       } >ram
185  .jcr            : { *(.jcr)           } >ram
186  .got            : { *(.got)           } >ram
187  .plt            : { *(.plt)           } >ram
188  .hash           : { *(.hash)          } >ram
189  .dynrel         : { *(.dynrel)        } >ram
190  .dynsym         : { *(.dynsym)        } >ram
191  .dynstr         : { *(.dynstr)        } >ram
192  .hash           : { *(.hash)          } >ram
193  .shbss :
194  {
195    *(.shbss)
196  } > ram
197  .bss :
198  {
199    __bss_start = ALIGN(0x8);
200    _bss_start = .;
201    bss_start = .;
202    *(.bss .bss* .gnu.linkonce.b*)
203    *(COMMON)
204    . = ALIGN (16);
205    end = .;
206    _end = ALIGN(0x8);
207    __end = ALIGN(0x8);
208  } > ram
209  .stab . (NOLOAD) :
210  {
211    [ .stab ]
212  }
213  .stabstr . (NOLOAD) :
214  {
215    [ .stabstr ]
216  }
217}
Note: See TracBrowser for help on using the repository browser.