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

Last change on this file since 1fcdd639 was 1fcdd639, checked in by Joel Sherrill <joel@…>, on Jan 12, 2017 at 10:12:51 PM

powerpc/shared/linkcmds.base: Add .rela.rtemsroset and .rela.rtemsrwset

  • Property mode set to 100644
File size: 4.9 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      *(.rela.rtemsroset*)
152      *(.rela.rtemsrwset*)
153    } >ram
154  .data :
155  {
156    data_start = .;
157    _data_start = .;
158    _sdata = . ;
159    *(.data*)
160    *(.gnu.linkonce.d*)
161    . = ALIGN(0x10);
162    *(.gcc_except_table*)
163    . = ALIGN(0x10);
164    edata = .;
165    _edata = .;
166  } > ram
167  _data_load_start = LOADADDR (.data);
168  .rtemsrwset : {
169    KEEP (*(SORT(.rtemsrwset.*)))
170  } >ram
171  .dynamic        : { *(.dynamic)       } >ram
172  .jcr            : { *(.jcr)           } >ram
173  .got            : { *(.got)           } >ram
174  .plt            : { *(.plt)           } >ram
175  .hash           : { *(.hash)          } >ram
176  .dynrel         : { *(.dynrel)        } >ram
177  .dynsym         : { *(.dynsym)        } >ram
178  .dynstr         : { *(.dynstr)        } >ram
179  .hash           : { *(.hash)          } >ram
180  .shbss :
181  {
182    *(.shbss)
183  } > ram
184  .bss :
185  {
186    __bss_start = ALIGN(0x8);
187    _bss_start = .;
188    bss_start = .;
189    *(.bss .bss* .gnu.linkonce.b*)
190    *(COMMON)
191    . = ALIGN (16);
192    end = .;
193    _end = ALIGN(0x8);
194    __end = ALIGN(0x8);
195  } > ram
196  .stab . (NOLOAD) :
197  {
198    [ .stab ]
199  }
200  .stabstr . (NOLOAD) :
201  {
202    [ .stabstr ]
203  }
204}
Note: See TracBrowser for help on using the repository browser.