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

5
Last change on this file since ea7f4a0c was ea7f4a0c, checked in by Joel Sherrill <joel@…>, on Jan 30, 2018 at 11:25:20 PM

sparc/*/linkcmds*: Move ENTRY() from linkcmds.base to top linkcmds

This was at the request of a user to make it easier to have a
custom entry point. This way they just provide their own top
level linkcmds and include linkcmds.base.

Updates #3520.

  • Property mode set to 100644
File size: 4.9 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 (*crtbegin.o(.dtors))
93    KEEP (*crtbegin?.o(.dtors))
94    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
95    KEEP (*(SORT(.dtors*)))
96
97    _rodata_start = . ;
98    *(.rodata*)
99    *(.gnu.linkonce.r*)
100    _erodata = ALIGN( 0x10 ) ;
101
102    etext = ALIGN(0x10);
103    _etext = .;
104    KEEP(*(.init*))
105    KEEP(*(.fini*))
106    *(.lit)
107    *(.shdata)
108    . = ALIGN (16);
109  } > ram
110  .tdata : {
111    _TLS_Data_begin = .;
112    *(.tdata .tdata.* .gnu.linkonce.td.*)
113    _TLS_Data_end = .;
114  } > ram
115  .tbss : {
116    _TLS_BSS_begin = .;
117    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
118    _TLS_BSS_end = .;
119  } > ram
120  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
121  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
122  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
123  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
124  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
125  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
126  .rtemsroset : {
127    /* for pre rtems-libbsd FreeBSD code */
128    __start_set_sysctl_set = .;
129    KEEP(*(set_sysctl_*));
130    __stop_set_sysctl_set = .;
131    KEEP(*(set_domain_*));
132    KEEP(*(set_pseudo_*));
133
134    KEEP (*(SORT(.rtemsroset.*)))
135
136    . = ALIGN (16);
137    _endtext = .;
138  } >ram
139  .rela.dyn       :
140    {
141      *(.rela.init)
142      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
143      *(.rela.fini)
144      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
145      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
146      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
147      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
148      *(.rela.ctors)
149      *(.rela.dtors)
150      *(.rela.got)
151      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
152      *(.rela.rtemsroset*)
153      *(.rela.rtemsrwset*)
154    } >ram
155  .data :
156  {
157    data_start = .;
158    _data_start = .;
159    _sdata = . ;
160    *(.data*)
161    *(.gnu.linkonce.d*)
162    . = ALIGN(0x10);
163    *(.gcc_except_table*)
164    . = ALIGN(0x10);
165    edata = .;
166    _edata = .;
167  } > ram
168  _data_load_start = LOADADDR (.data);
169  .rtemsrwset : {
170    KEEP (*(SORT(.rtemsrwset.*)))
171  } >ram
172  .dynamic        : { *(.dynamic)       } >ram
173  .jcr            : { *(.jcr)           } >ram
174  .got            : { *(.got)           } >ram
175  .plt            : { *(.plt)           } >ram
176  .hash           : { *(.hash)          } >ram
177  .dynrel         : { *(.dynrel)        } >ram
178  .dynsym         : { *(.dynsym)        } >ram
179  .dynstr         : { *(.dynstr)        } >ram
180  .hash           : { *(.hash)          } >ram
181  .shbss :
182  {
183    *(.shbss)
184  } > ram
185  .bss :
186  {
187    __bss_start = ALIGN(0x8);
188    _bss_start = .;
189    bss_start = .;
190    *(.bss .bss* .gnu.linkonce.b*)
191    *(COMMON)
192    . = ALIGN (16);
193    end = .;
194    _end = ALIGN(0x8);
195    __end = ALIGN(0x8);
196  } > ram
197  .stab . (NOLOAD) :
198  {
199    [ .stab ]
200  }
201  .stabstr . (NOLOAD) :
202  {
203    [ .stabstr ]
204  }
205}
Note: See TracBrowser for help on using the repository browser.