source: rtems/bsps/powerpc/haleakala/start/linkcmds @ ec1dd51a

5
Last change on this file since ec1dd51a was ec1dd51a, checked in by Chris Johns <chrisj@…>, on Mar 6, 2019 at 10:15:56 AM

libdl: Add small data support to the remaining PowerPC BSPs.

Updates #3687

  • Property mode set to 100644
File size: 7.5 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the 405GP/EX
4 *  This file is intended to be used together with dlentry.s
5 *  it will generate downloadable code
6 *
7 *  Modifications for gen405 by Dennis Ehlin
8 *  Modifications for virtex by Keith, Greg, and Bob
9 *  Modifications for 405GP/EX by Michael Hamel
10 */
11
12OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
13OUTPUT_ARCH(powerpc)
14STARTUP(start.o)
15ENTRY(download_entry)
16EXTERN(__vectors)
17
18RamBase = DEFINED(RamBase) ? RamBase : 0;
19RamSize = DEFINED(RamSize) ? RamSize : 256M;
20HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
21
22MEMORY {
23        RAM : ORIGIN = 0, LENGTH = 256M
24        /*FLASH : ORIGIN = 0xFFE00000, LENGTH = 16M*/
25}
26
27/*
28 * Max sdata/bss.
29 */
30bsp_section_small_data_area_size = 65536;
31
32SECTIONS
33{
34  /* First 16K is occupied by exception vectors and anything else we want to put there */
35  .text 0x4000:
36  {
37     text.start = . ;
38     *(.entry)
39     *(.entry2)
40     *(.text*)
41     *(.rodata*)
42     *(.rodata1)
43     KEEP (*(SORT(.rtemsroset.*)))
44
45     /*
46      * Special FreeBSD sysctl sections.
47      */
48     . = ALIGN (16);
49     __start_set_sysctl_set = .;
50     *(set_sysctl_*);
51     __stop_set_sysctl_set = ABSOLUTE(.);
52     *(set_domain_*);
53     *(set_pseudo_*);
54
55    /* C++ constructors/destructors */
56    *(.gnu.linkonce.t*)
57
58    /*  Initialization and finalization code.
59     *
60     *  Various files can provide initialization and finalization functions.
61     *  The bodies of these functions are in .init and .fini sections. We
62     *  accumulate the bodies here, and prepend function prologues from
63     *  ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
64     *  first; ecrtn.o must be linked last. Because these are wildcards, it
65     *  doesn't matter if the user does not actually link against ecrti.o and
66     *  ecrtn.o; the linker won't look for a file to match a wildcard.  The
67     *  wildcard also means that it doesn't matter which directory ecrti.o
68     *  and ecrtn.o are in.
69     */
70    PROVIDE (_init = .);
71    *ecrti.o(.init)
72    *(.init)
73    *ecrtn.o(.init)
74   
75    PROVIDE (_fini = .);
76    *ecrti.o(.fini)
77    *(.fini)
78    *ecrtn.o(.init)
79
80    /*
81     *  C++ constructors and destructors for static objects.
82     *  PowerPC EABI does not use crtstuff yet, so we build "old-style"
83     *  constructor and destructor lists that begin with the list length
84     *  end terminate with a NULL entry.
85     */
86     
87    PROVIDE (__CTOR_LIST__ = .);             
88    *crtbegin.o(.ctors)
89    *(.ctors)
90    *crtend.o(.ctors)
91    LONG(0)
92    PROVIDE (__CTOR_END__ = .);
93       
94    PROVIDE (__DTOR_LIST__ = .);
95    *crtbegin.o(.dtors)
96    *(.dtors)
97    *crtend.o(.dtors)
98    LONG(0)
99    PROVIDE (__DTOR_END__ = .);
100       
101    /* Exception frame info */
102     *(.eh_frame)
103    /* Miscellaneous read-only data */
104    _rodata_start = . ;
105    *(.gnu.linkonce.r*)
106    *(.lit)
107    *(.shdata)
108    *(.rodata)
109    *(.rodata1)
110    *(.descriptors)
111    *(rom_ver)
112    _erodata = .;
113
114    PROVIDE (__EXCEPT_START__ = .);
115    *(.gcc_except_table*)
116    PROVIDE (__EXCEPT_END__ = .);
117    __GOT_START__ = .;
118    s.got = .;
119    *(.got.plt)
120    *(.got)
121    *(.got1)
122    PROVIDE (__GOT2_START__ = .);
123    PROVIDE (_GOT2_START_ = .);
124    *(.got2)
125    PROVIDE (__GOT2_END__ = .);
126    PROVIDE (_GOT2_END_ = .);
127   
128    PROVIDE (__FIXUP_START__ = .);
129    PROVIDE (_FIXUP_START_ = .);
130    *(.fixup)
131    PROVIDE (_FIXUP_END_ = .);
132    PROVIDE (__FIXUP_END__ = .);
133   
134
135    /* Various possible names for the end of the .text section */
136     etext = ALIGN(0x10);
137     _etext = .;
138
139     *(.lit)
140     *(.shdata)
141     _endtext = ALIGN(0x10);
142     text.end = .;
143     text.size = text.end - text.start;
144  } >RAM
145
146  text.size = text.end - text.start;
147
148  .tdata : {
149    _TLS_Data_begin = .;
150    *(.tdata .tdata.* .gnu.linkonce.td.*)
151    _TLS_Data_end = .;
152  } >RAM
153
154  .tbss : {
155    _TLS_BSS_begin = .;
156    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
157    _TLS_BSS_end = .;
158  } >RAM
159
160  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
161  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
162  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
163  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
164  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
165  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
166
167  .jcr : { KEEP (*(.jcr)) } >RAM
168
169    .rel.dyn : {
170      *(.rel.init)
171      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
172      *(.rel.fini)
173      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
174      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
175      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
176      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
177      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
178      *(.rel.ctors)
179      *(.rel.dtors)
180      *(.rel.got)
181      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
182      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
183      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
184      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
185      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
186    } >RAM
187    .rela.dyn : {
188      *(.rela.init)
189      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
190      *(.rela.fini)
191      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
192      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
193      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
194      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
195      *(.rela.ctors)
196      *(.rela.dtors)
197      *(.rela.got)
198      *(.rela.got1)
199      *(.rela.got2)
200      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
201      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
202      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
203      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
204      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
205    } >RAM
206
207
208    /* Initialised large data */
209    .data ( . ) :
210    {
211      . = ALIGN (4);
212      data.start = .;
213      *(.data)
214      *(.data1)
215      KEEP (*(SORT(.rtemsrwset.*)))
216      *(.data.* .gnu.linkonce.d.*)
217      data.end = .;
218    } > RAM
219
220        /* Initialised small data addressed as offsets from r13 */
221        .sdata : {
222      . = ALIGN (4);
223          PROVIDE (__SDATA_START__ = .);
224      bsp_section_sdata_begin = .;
225      sdata.start = .;
226          *(.sdata*)
227      *(.gnu.linkonce.s.*)
228          sdata.end = .;
229      bsp_section_sdata_end = .;
230        } > RAM
231
232        /* Zeroed small data addressed as offsets from r13 */
233   .sbss : {
234      . = ALIGN (4);
235          PROVIDE(__SBSS_START__ = .);
236      bsp_section_sbss_begin = .;
237          sbss.start = .;
238      *(.sbss .sbss.* *.gnu.linkonce.sb.*);
239          sbss.end = .;
240      bsp_section_sbss_end = .;
241      bsp_section_sdata_libdl_begin = .;
242      . = DEFINED(bsp_section_small_data_area_size) ?
243            bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
244      bsp_section_sdata_libdl_end = .;
245    } > RAM
246    PROVIDE(__SBSS_END__ = .);
247
248        /* Zeroed large data */
249        .bss : {
250      . = ALIGN (4);
251          bss.start = .;
252      *(.bss .bss* .gnu.linkonce.b*)
253      . = ALIGN(4);
254      bss.end = .;
255    } > RAM
256
257    bss.size = bss.end - bss.start;
258    sbss.size = sbss.end - sbss.start;
259
260    .rtemsstack (NOLOAD) : {
261        *(SORT(.rtemsstack.*))
262    } >RAM
263
264    WorkAreaBase = .;
265
266        /* Debugging information */
267    .line 0 : { *(.line) }
268    .debug 0 : { *(.debug) }
269    .debug_sfnames 0 : { *(.debug_sfnames) }
270    .debug_srcinfo 0 : { *(.debug_srcinfo) }
271    .debug_pubnames 0 : { *(.debug_pubnames) }
272    .debug_aranges 0 : { *(.debug_aranges) }
273    .debug_aregion 0 : { *(.debug_aregion) }
274    .debug_macinfo 0 : { *(.debug_macinfo) }
275    .stab 0 : { *(.stab) }
276    .stabstr 0 : { *(.stabstr) }
277}
Note: See TracBrowser for help on using the repository browser.