Warning, /bsps/m68k/mcf52235/start/linkcmds is written in an unsupported language. File is not indexed.
0001 /* SPDX-License-Identifier: BSD-2-Clause */
0002
0003 /*
0004 * This file contains directives for the GNU linker which are specific
0005 * to the Freescale ColdFire mcf52235
0006 *
0007 * COPYRIGHT (c) 1989-1999.
0008 * On-Line Applications Research Corporation (OAR).
0009 *
0010 * Redistribution and use in source and binary forms, with or without
0011 * modification, are permitted provided that the following conditions
0012 * are met:
0013 * 1. Redistributions of source code must retain the above copyright
0014 * notice, this list of conditions and the following disclaimer.
0015 * 2. Redistributions in binary form must reproduce the above copyright
0016 * notice, this list of conditions and the following disclaimer in the
0017 * documentation and/or other materials provided with the distribution.
0018 *
0019 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
0020 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
0021 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
0022 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
0023 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
0024 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
0025 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0026 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
0027 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
0028 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0029 * POSSIBILITY OF SUCH DAMAGE.e
0030 */
0031
0032 /*
0033 * Declare some sizes.
0034 */
0035 RamBase = DEFINED(RamBase) ? RamBase : 0x20000000;
0036 RamSize = DEFINED(RamSize) ? RamSize : 32K;
0037 RamEnd = RamBase + RamSize;
0038 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
0039 _FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x00000000;
0040
0041 _VBR = 0x20000000;
0042
0043 ENTRY(start)
0044 STARTUP(start.o)
0045
0046 MEMORY
0047 {
0048 sram : ORIGIN = 0x20000000, LENGTH = 32K
0049 flash : ORIGIN = 0x00000000, LENGTH = 256K
0050 }
0051
0052 SECTIONS
0053 {
0054 /*
0055 * Text, data and bss segments
0056 */
0057 .text : {
0058
0059 *(.text*)
0060 *(.ram_code)
0061
0062 /*
0063 * C++ constructors/destructors
0064 */
0065 *(.gnu.linkonce.t.*)
0066
0067 /*
0068 * Initialization and finalization code.
0069 *
0070 * Various files can provide initialization and finalization
0071 * functions. crtbegin.o and crtend.o are two instances. The
0072 * body of these functions are in .init and .fini sections. We
0073 * accumulate the bodies here, and prepend function prologues
0074 * from crti.o and function epilogues from crtn.o. crti.o must
0075 * be linked first; crtn.o must be linked last. Because these
0076 * are wildcards, it doesn't matter if the user does not
0077 * actually link against crti.o and crtn.o; the linker won't
0078 * look for a file to match a wildcard. The wildcard also
0079 * means that it doesn't matter which directory crti.o and
0080 * crtn.o are in.
0081 */
0082 PROVIDE (_init = .);
0083 *crti.o(.init)
0084 *(.init)
0085 *crtn.o(.init)
0086 PROVIDE (_fini = .);
0087 *crti.o(.fini)
0088 *(.fini)
0089 *crtn.o(.fini)
0090
0091 /*
0092 * Special FreeBSD sysctl sections.
0093 */
0094 . = ALIGN (16);
0095 __start_set_sysctl_set = .;
0096 *(set_sysctl_*);
0097 __stop_set_sysctl_set = ABSOLUTE(.);
0098 *(set_domain_*);
0099 *(set_pseudo_*);
0100
0101 /*
0102 * C++ constructors/destructors
0103 *
0104 * gcc uses crtbegin.o to find the start of the constructors
0105 * and destructors so we make sure it is first. Because this
0106 * is a wildcard, it doesn't matter if the user does not
0107 * actually link against crtbegin.o; the linker won't look for
0108 * a file to match a wildcard. The wildcard also means that
0109 * it doesn't matter which directory crtbegin.o is in. The
0110 * constructor and destructor list are terminated in
0111 * crtend.o. The same comments apply to it.
0112 */
0113 . = ALIGN (16);
0114 *crtbegin.o(.ctors)
0115 *(.ctors)
0116 *crtend.o(.ctors)
0117 *crtbegin.o(.dtors)
0118 *(.dtors)
0119 *crtend.o(.dtors)
0120
0121 /*
0122 * Exception frame info
0123 */
0124 . = ALIGN (16);
0125 *(.eh_frame)
0126
0127 /*
0128 * Read-only data
0129 */
0130 . = ALIGN (16);
0131 _rodata_start = . ;
0132 *(.rodata*)
0133 KEEP (*(SORT(.rtemsroset.*)))
0134 *(.gnu.linkonce.r*)
0135
0136 . = ALIGN (16);
0137
0138 *(.console_gdb_xfer)
0139 *(.bootstrap_data)
0140 } >flash
0141
0142 .tdata : {
0143 _TLS_Data_begin = .;
0144 *(.tdata .tdata.* .gnu.linkonce.td.*)
0145 _TLS_Data_end = .;
0146 . = ALIGN(16);
0147 _estuff = .;
0148 PROVIDE (_etext = .);
0149 } >flash
0150
0151 .tbss : {
0152 _TLS_BSS_begin = .;
0153 *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0154 _TLS_BSS_end = .;
0155 } >flash
0156
0157 _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0158 _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0159 _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0160 _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0161 _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0162 _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0163
0164 .data 0x20000400 : AT (_estuff)
0165 {
0166 PROVIDE( _data_dest_start = . );
0167 PROVIDE( _copy_start = .);
0168 *(.data)
0169 *(.data.*)
0170 KEEP (*(SORT(.rtemsrwset.*)))
0171 *(.gnu.linkonce.d*)
0172 *(.gcc_except_table*)
0173 *(.jcr)
0174 . = ALIGN (16);
0175 PROVIDE (_edata = .);
0176 PROVIDE (_copy_end = .);
0177 PROVIDE (_data_dest_end = . );
0178 } >sram
0179
0180 _data_src_start = _estuff;
0181 _data_src_end = _data_dest_start + SIZEOF(.data);
0182
0183 .bss :
0184 {
0185 PROVIDE (_clear_start = .);
0186 *(.bss*)
0187 *(COMMON)
0188 . = ALIGN (16);
0189 PROVIDE (_end = .);
0190 PROVIDE (_clear_end = .);
0191 } >sram
0192
0193 .noinit (NOLOAD) : {
0194 *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0195 } >sram
0196
0197 .rtemsstack (NOLOAD) : {
0198 *(SORT(.rtemsstack.*))
0199 PROVIDE(WorkAreaBase = .);
0200 } >sram
0201
0202 /* Stabs debugging sections. */
0203 .stab 0 : { *(.stab) }
0204 .stabstr 0 : { *(.stabstr) }
0205 .stab.excl 0 : { *(.stab.excl) }
0206 .stab.exclstr 0 : { *(.stab.exclstr) }
0207 .stab.index 0 : { *(.stab.index) }
0208 .stab.indexstr 0 : { *(.stab.indexstr) }
0209 .comment 0 : { *(.comment) }
0210
0211 /* Addition to let linker know about custom section for GDB pretty-printing support. */
0212 .debug_gdb_scripts 0 : { *(.debug_gdb_scripts) }
0213
0214 PROVIDE (end_of_all = .);
0215 }