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 01/30/18 at 23:25:20

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
RevLine 
[c8941b0]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
[31c8db4]52STARTUP(start.o)
53
[c8941b0]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
[95cb09e]67    KEEP(*(.eh_frame*))
[c8941b0]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))
[95cb09e]91    KEEP (*(SORT(.ctors*)))
[c8941b0]92    KEEP (*crtbegin.o(.dtors))
93    KEEP (*crtbegin?.o(.dtors))
94    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
[95cb09e]95    KEEP (*(SORT(.dtors*)))
[c8941b0]96
97    _rodata_start = . ;
98    *(.rodata*)
99    *(.gnu.linkonce.r*)
100    _erodata = ALIGN( 0x10 ) ;
101
102    etext = ALIGN(0x10);
103    _etext = .;
[95cb09e]104    KEEP(*(.init*))
105    KEEP(*(.fini*))
[c8941b0]106    *(.lit)
107    *(.shdata)
108    . = ALIGN (16);
109  } > ram
[960fd85]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;
[d60e760]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;
[960fd85]123  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
124  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
[d60e760]125  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
[e4927ece]126  .rtemsroset : {
[c2395717]127    /* for pre rtems-libbsd FreeBSD code */
128    __start_set_sysctl_set = .;
[24a6943]129    KEEP(*(set_sysctl_*));
[c2395717]130    __stop_set_sysctl_set = .;
[24a6943]131    KEEP(*(set_domain_*));
132    KEEP(*(set_pseudo_*));
[c2395717]133
[e4927ece]134    KEEP (*(SORT(.rtemsroset.*)))
[c2395717]135
[aae7daa9]136    . = ALIGN (16);
137    _endtext = .;
[c2395717]138  } >ram
[c8941b0]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.*)
[1fcdd639]152      *(.rela.rtemsroset*)
153      *(.rela.rtemsrwset*)
[c8941b0]154    } >ram
155  .data :
156  {
157    data_start = .;
158    _data_start = .;
159    _sdata = . ;
160    *(.data*)
161    *(.gnu.linkonce.d*)
[95cb09e]162    . = ALIGN(0x10);
[c8941b0]163    *(.gcc_except_table*)
164    . = ALIGN(0x10);
165    edata = .;
166    _edata = .;
167  } > ram
[fac8a3a]168  _data_load_start = LOADADDR (.data);
[91c250fc]169  .rtemsrwset : {
170    KEEP (*(SORT(.rtemsrwset.*)))
171  } >ram
[c8941b0]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.