source: rtems/c/src/lib/libbsp/sparc/shared/startup/linkcmds.base @ 91c250fc

4.115
Last change on this file since 91c250fc was 91c250fc, checked in by Sebastian Huber <sebastian.huber@…>, on Mar 15, 2015 at 9:12:29 AM

bsps/sparc: Fix linker section

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