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

4.115
Last change on this file since 960fd85 was 960fd85, checked in by Sebastian Huber <sebastian.huber@…>, on 01/28/14 at 10:52:17

bsps: Thread-local storage (TLS) for linkcmds

  • Property mode set to 100644
File size: 4.6 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    *(.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 (*(.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    KEEP (*(.dtors))
97
98    _rodata_start = . ;
99    *(.rodata*)
100    *(.gnu.linkonce.r*)
101    _erodata = ALIGN( 0x10 ) ;
102
103    etext = ALIGN(0x10);
104    _etext = .;
105    KEEP(*(.init))
106    KEEP(*(.fini))
107    *(.lit)
108    *(.shdata)
109    . = ALIGN (16);
110  } > ram
111  .tdata : {
112    _TLS_Data_begin = .;
113    *(.tdata .tdata.* .gnu.linkonce.td.*)
114    _TLS_Data_end = .;
115  } > ram
116  .tbss : {
117    _TLS_BSS_begin = .;
118    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
119    _TLS_BSS_end = .;
120  } > ram
121  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
122  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
123  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
124  _TLS_Alignment = ALIGNOF (.tdata);
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  .rtemsrwset : {
153    KEEP (*(SORT(.rtemsrwset.*)))
154  } >ram
155  .data :
156  {
157    data_start = .;
158    _data_start = .;
159    _sdata = . ;
160    *(.data*)
161    *(.gnu.linkonce.d*)
162    *(.gcc_except_table*)
163    . = ALIGN(0x10);
164    edata = .;
165    _edata = .;
166  } > ram
167  .dynamic        : { *(.dynamic)       } >ram
168  .jcr            : { *(.jcr)           } >ram
169  .got            : { *(.got)           } >ram
170  .plt            : { *(.plt)           } >ram
171  .hash           : { *(.hash)          } >ram
172  .dynrel         : { *(.dynrel)        } >ram
173  .dynsym         : { *(.dynsym)        } >ram
174  .dynstr         : { *(.dynstr)        } >ram
175  .hash           : { *(.hash)          } >ram
176  .shbss :
177  {
178    *(.shbss)
179  } > ram
180  .bss :
181  {
182    __bss_start = ALIGN(0x8);
183    _bss_start = .;
184    bss_start = .;
185    *(.bss .bss* .gnu.linkonce.b*)
186    *(COMMON)
187    . = ALIGN (16);
188    end = .;
189    _end = ALIGN(0x8);
190    __end = ALIGN(0x8);
191  } > ram
192  .stab . (NOLOAD) :
193  {
194    [ .stab ]
195  }
196  .stabstr . (NOLOAD) :
197  {
198    [ .stabstr ]
199  }
200}
Note: See TracBrowser for help on using the repository browser.