Warning, /bsps/m68k/gen68340/start/linkcmds is written in an unsupported language. File is not indexed.
0001 /*
0002 * This file contains GNU linker directives for a generic MC68340/349 board.
0003 * Variations in hardware type and dynamic memory size can be made
0004 * by overriding some values with linker command-line arguments.
0005 *
0006 * ATTENTION: RAM and ROM placement must accord those in start340.S!!
0007 * (next time I'll use some shared variables :) )
0008 *
0009 * Geoffroy Montel
0010 * France Telecom - CNET/DSM/TAM/CAT
0011 * 4, rue du Clos Courtel
0012 * 35512 CESSON-SEVIGNE
0013 * FRANCE
0014 *
0015 * e-mail: g_montel@yahoo.com
0016 */
0017
0018 /*
0019 * Declare some sizes.
0020 */
0021 RamBase = DEFINED(RamBase) ? RamBase : 0x10000000;
0022 RamSize = DEFINED(RamSize) ? RamSize : 4M;
0023 RamEnd = RamBase + RamSize;
0024 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
0025
0026 /*
0027 * Declare on-board memory.
0028 * It would be nice if the ram length could be given as
0029 * LENGTH=RamSize, but gld doesn't allow non-constant
0030 * values in the LENGTH expression.
0031 */
0032 MEMORY {
0033 ram : ORIGIN = 0x10000000, LENGTH = 4M
0034 rom : ORIGIN = 0x01000000, LENGTH = 4M
0035 /* dpram : ORIGIN = 0xFE000000, LENGTH = 8k */
0036 }
0037
0038 ENTRY(start)
0039 STARTUP(start.o)
0040
0041 /*
0042 * Declare low-order three octets of Ethernet address.
0043 */
0044 ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;
0045
0046 /*
0047 * Load objects
0048 */
0049 SECTIONS {
0050
0051 /*
0052 * Boot PROM
0053 */
0054 rom : {
0055 _RomBase = .;
0056 __RomBase = .;
0057 } >rom
0058
0059 /*
0060 * Dynamic RAM
0061 */
0062 ram : {
0063 . = .;
0064 } >ram
0065
0066 /*
0067 * Text, data and bss segments
0068 */
0069 .text : {
0070 *(.text*)
0071
0072 /*
0073 * C++ constructors/destructors
0074 */
0075 *(.gnu.linkonce.t.*)
0076
0077 /*
0078 * Initialization and finalization code.
0079 *
0080 * Various files can provide initialization and finalization
0081 * functions. crtbegin.o and crtend.o are two instances. The
0082 * body of these functions are in .init and .fini sections. We
0083 * accumulate the bodies here, and prepend function prologues
0084 * from crti.o and function epilogues from crtn.o. crti.o must
0085 * be linked first; crtn.o must be linked last. Because these
0086 * are wildcards, it doesn't matter if the user does not
0087 * actually link against crti.o and crtn.o; the linker won't
0088 * look for a file to match a wildcard. The wildcard also
0089 * means that it doesn't matter which directory crti.o and
0090 * crtn.o are in.
0091 */
0092 PROVIDE (_init = .);
0093 *crti.o(.init)
0094 *(.init)
0095 *crtn.o(.init)
0096 PROVIDE (_fini = .);
0097 *crti.o(.fini)
0098 *(.fini)
0099 *crtn.o(.fini)
0100
0101 /*
0102 * Special FreeBSD sysctl sections.
0103 */
0104 . = ALIGN (16);
0105 __start_set_sysctl_set = .;
0106 *(set_sysctl_*);
0107 __stop_set_sysctl_set = ABSOLUTE(.);
0108 *(set_domain_*);
0109 *(set_pseudo_*);
0110
0111 /*
0112 * C++ constructors/destructors
0113 *
0114 * gcc uses crtbegin.o to find the start of the constructors
0115 * and destructors so we make sure it is first. Because this
0116 * is a wildcard, it doesn't matter if the user does not
0117 * actually link against crtbegin.o; the linker won't look for
0118 * a file to match a wildcard. The wildcard also means that
0119 * it doesn't matter which directory crtbegin.o is in. The
0120 * constructor and destructor list are terminated in
0121 * crtend.o. The same comments apply to it.
0122 */
0123 . = ALIGN (16);
0124 *crtbegin.o(.ctors)
0125 *(.ctors)
0126 *crtend.o(.ctors)
0127 *crtbegin.o(.dtors)
0128 *(.dtors)
0129 *crtend.o(.dtors)
0130
0131 /*
0132 * Exception frame info
0133 */
0134 . = ALIGN (16);
0135 *(.eh_frame)
0136
0137 /*
0138 * Read-only data
0139 */
0140 . = ALIGN (16);
0141 _rodata_start = . ;
0142 *(.rodata*)
0143 KEEP (*(SORT(.rtemsroset.*)))
0144 *(.gnu.linkonce.r*)
0145
0146 . = ALIGN (16);
0147 PROVIDE (_etext = .);
0148 } >ram
0149
0150 .tdata : {
0151 _TLS_Data_begin = .;
0152 *(.tdata .tdata.* .gnu.linkonce.td.*)
0153 _TLS_Data_end = .;
0154 } >ram
0155
0156 .tbss : {
0157 _TLS_BSS_begin = .;
0158 *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
0159 _TLS_BSS_end = .;
0160 } >ram
0161
0162 _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
0163 _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
0164 _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
0165 _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
0166 _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
0167 _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
0168
0169 .data : {
0170 PROVIDE (_copy_start = .);
0171 *(.data*)
0172 KEEP (*(SORT(.rtemsrwset.*)))
0173 *(.gnu.linkonce.d*)
0174 *(.gcc_except_table*)
0175 *(.jcr)
0176 . = ALIGN (16);
0177 PROVIDE (_edata = .);
0178 PROVIDE (_copy_end = .);
0179 } >ram
0180 .bss : {
0181 M68Kvec = .;
0182 . += (256 * 4);
0183 _clear_start = .;
0184 *(.dynbss)
0185 *(.bss* .gnu.linkonce.b.*)
0186 *(COMMON)
0187 . = ALIGN (16);
0188 PROVIDE (end = .);
0189 _clear_end = .;
0190 } >ram
0191
0192 .noinit (NOLOAD) : {
0193 *(SORT_BY_NAME (SORT_BY_ALIGNMENT (.noinit*)))
0194 } >ram
0195
0196 .rtemsstack (NOLOAD) : {
0197 *(SORT(.rtemsstack.*))
0198 WorkAreaBase = .;
0199 } >ram
0200
0201 /*
0202 * On-chip memory/peripherals
0203 *
0204 */
0205 dpram : {
0206 m340 = .;
0207 _m340 = .;
0208 . += (8 * 1024);
0209 } >ram
0210
0211
0212 /* Stabs debugging sections. */
0213 .stab 0 : { *(.stab) }
0214 .stabstr 0 : { *(.stabstr) }
0215 .stab.excl 0 : { *(.stab.excl) }
0216 .stab.exclstr 0 : { *(.stab.exclstr) }
0217 .stab.index 0 : { *(.stab.index) }
0218 .stab.indexstr 0 : { *(.stab.indexstr) }
0219 .comment 0 : { *(.comment) }
0220
0221 /* DWARF debug sections.
0222 Symbols in the DWARF debugging sections are relative to the beginning
0223 of the section so we begin them at 0. */
0224 /* DWARF 1 */
0225 .debug 0 : { *(.debug) }
0226 .line 0 : { *(.line) }
0227
0228 /* GNU DWARF 1 extensions */
0229 .debug_srcinfo 0 : { *(.debug_srcinfo) }
0230 .debug_sfnames 0 : { *(.debug_sfnames) }
0231
0232 /* DWARF 1.1 and DWARF 2 */
0233 .debug_aranges 0 : { *(.debug_aranges) }
0234 .debug_pubnames 0 : { *(.debug_pubnames) }
0235
0236 /* DWARF 2 */
0237 .debug_info 0 : { *(.debug_info) }
0238 .debug_abbrev 0 : { *(.debug_abbrev) }
0239 .debug_line 0 : { *(.debug_line) }
0240 .debug_frame 0 : { *(.debug_frame) }
0241 .debug_str 0 : { *(.debug_str) }
0242 .debug_loc 0 : { *(.debug_loc) }
0243 .debug_macinfo 0 : { *(.debug_macinfo) }
0244
0245 /* SGI/MIPS DWARF 2 extensions */
0246 .debug_weaknames 0 : { *(.debug_weaknames) }
0247 .debug_funcnames 0 : { *(.debug_funcnames) }
0248 .debug_typenames 0 : { *(.debug_typenames) }
0249 .debug_varnames 0 : { *(.debug_varnames) }
0250 /* These must appear regardless of . */
0251
0252 /* Addition to let linker know about custom section for GDB pretty-printing support. */
0253 .debug_gdb_scripts 0 : { *(.debug_gdb_scripts) }
0254 }