source: rtems/bsps/m68k/mcf5329/start/linkcmdsflash @ c46ec2b

Last change on this file since c46ec2b was c46ec2b, checked in by Joel Sherrill <joel@…>, on 07/08/22 at 13:57:11

bsps/m68k/mcf5329: Change license to BSD-2

Updates #3053.

  • Property mode set to 100644
File size: 6.5 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/*
4 *  This file contains directives for the GNU linker which are specific
5 *  to the Freescale ColdFire mcf52235
6 *
7 *  COPYRIGHT (c) 1989-1999.
8 *  On-Line Applications Research Corporation (OAR).
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.e
30 */
31
32/*
33 * Declare some sizes.
34 */
35_CoreSRamBase = DEFINED(RamBase) ? RamBase : 0x80000000;
36_CoreSRamSize = DEFINED(RamSize) ? RamSize : 32K;
37
38RamBase = DEFINED(RamBase) ? RamBase : 0x40000000;
39RamSize = DEFINED(RamSize) ? RamSize : 32M;
40RamEnd = RamBase + RamSize;
41
42_BootFlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x00000000;
43_BootFlashSize = DEFINED(_FlashBase) ? _FlashBase : 2M;
44
45HeapSize = DEFINED(HeapSize) ? HeapSize : 0;
46
47_VBR = 0x40000000;
48
49ENTRY(start)
50STARTUP(start.o)
51
52MEMORY
53{
54    core_sram : ORIGIN = 0x80000000, LENGTH = 32K
55    boot_flash : ORIGIN = 0x00000000, LENGTH = 2M
56    dram : ORIGIN = 0x40000000, LENGTH = 32M
57}
58
59SECTIONS
60{
61    /*
62    * Text, data and bss segments
63    */
64    .text : {
65
66        *(.text*)
67        *(.ram_code)
68
69        /*
70        * C++ constructors/destructors
71        */
72        *(.gnu.linkonce.t.*)
73
74        /*
75        * Initialization and finalization code.
76        *
77        * Various files can provide initialization and finalization
78        * functions.  crtbegin.o and crtend.o are two instances. The
79        * body of these functions are in .init and .fini sections. We
80        * accumulate the bodies here, and prepend function prologues
81        * from crti.o and function epilogues from crtn.o. crti.o must
82        * be linked first; crtn.o must be linked last.  Because these
83        * are wildcards, it doesn't matter if the user does not
84        * actually link against crti.o and crtn.o; the linker won't
85        * look for a file to match a wildcard.  The wildcard also
86        * means that it doesn't matter which directory crti.o and
87        * crtn.o are in.
88        */
89        PROVIDE (_init = .);
90        *crti.o(.init)
91        *(.init)
92        *crtn.o(.init)
93        PROVIDE (_fini = .);
94        *crti.o(.fini)
95        *(.fini)
96        *crtn.o(.fini)
97
98        /*
99            * Special FreeBSD sysctl sections.
100            */
101        . = ALIGN (16);
102        __start_set_sysctl_set = .;
103        *(set_sysctl_*);
104        __stop_set_sysctl_set = ABSOLUTE(.);
105        *(set_domain_*);
106        *(set_pseudo_*);
107
108        /*
109        * C++ constructors/destructors
110        *
111        * gcc uses crtbegin.o to find the start of the constructors
112        * and destructors so we make sure it is first.  Because this
113        * is a wildcard, it doesn't matter if the user does not
114        * actually link against crtbegin.o; the linker won't look for
115        * a file to match a wildcard.  The wildcard also means that
116        * it doesn't matter which directory crtbegin.o is in. The
117        * constructor and destructor list are terminated in
118        * crtend.o.  The same comments apply to it.
119        */
120        . = ALIGN (16);
121        *crtbegin.o(.ctors)
122        *(.ctors)
123        *crtend.o(.ctors)
124        *crtbegin.o(.dtors)
125        *(.dtors)
126        *crtend.o(.dtors)
127
128        /*
129        * Exception frame info
130        */
131        . = ALIGN (16);
132        *(.eh_frame)
133
134        /*
135        * Read-only data
136        */
137        . = ALIGN (16);
138        _rodata_start = . ;
139        *(.rodata*)
140        KEEP (*(SORT(.rtemsroset.*)))
141        *(.gnu.linkonce.r*)
142
143        . = ALIGN (16);
144
145        *(.console_gdb_xfer)
146        *(.bootstrap_data)
147    } > boot_flash
148
149    .tdata : {
150        _TLS_Data_begin = .;
151        *(.tdata .tdata.* .gnu.linkonce.td.*)
152        _TLS_Data_end = .;
153        . = ALIGN(16);
154        _estuff = .;
155        PROVIDE (_etext = .);
156    } > boot_flash
157
158    .tbss : {
159        _TLS_BSS_begin = .;
160        *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
161        _TLS_BSS_end = .;
162    } > boot_flash
163
164    _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
165    _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
166    _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
167    _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
168    _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
169    _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
170
171    .data 0x40000500 : AT (_estuff)
172    {
173        PROVIDE( _data_dest_start = . );
174        PROVIDE( _copy_start = .);
175        *(.data*)
176        KEEP (*(SORT(.rtemsrwset.*)))
177        *(.gnu.linkonce.d*)
178        *(.gcc_except_table*)
179        *(.jcr)
180        . = ALIGN (16);
181        PROVIDE (_edata = .);
182        PROVIDE (_copy_end = .);
183        PROVIDE (_data_dest_end = . );
184    } > dram
185
186    _data_src_start = _estuff;
187    _data_src_end = _data_dest_start + SIZEOF(.data);
188
189    .bss :
190    {
191        _clear_start = .;
192        *(.bss*)
193        *(COMMON)
194        . = ALIGN (16);
195        PROVIDE (_end = .);
196        _clear_end = .;
197    } > dram
198
199    .noinit (NOLOAD) : {
200        *(.noinit*)
201        WorkAreaBase = .;
202    } > dram
203
204    .rtemsstack (NOLOAD) : {
205        *(SORT(.rtemsstack.*))
206    } > core_sram
207
208    /* Stabs debugging sections.  */
209    .stab 0 : { *(.stab) }
210    .stabstr 0 : { *(.stabstr) }
211    .stab.excl 0 : { *(.stab.excl) }
212    .stab.exclstr 0 : { *(.stab.exclstr) }
213    .stab.index 0 : { *(.stab.index) }
214    .stab.indexstr 0 : { *(.stab.indexstr) }
215    .comment 0 : { *(.comment) }
216
217    PROVIDE (end_of_all = .);
218}
Note: See TracBrowser for help on using the repository browser.