source: rtems/bsps/sparc/shared/start/linkcmds.base @ e10dec0

Last change on this file since e10dec0 was e10dec0, checked in by Sebastian Huber <sebastian.huber@…>, on 04/30/21 at 13:47:10

bsps: Support RTEMS_NOINIT in linkcmds

Update #3866.

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