1*1424dfb3Schristos# Copyright (C) 2014-2020 Free Software Foundation, Inc. 2*1424dfb3Schristos# 3*1424dfb3Schristos# Copying and distribution of this file, with or without modification, 4*1424dfb3Schristos# are permitted in any medium without royalty provided the copyright 5*1424dfb3Schristos# notice and this notice are preserved. 6*1424dfb3Schristos# 7*1424dfb3Schristos# Unusual variables checked by this code: 8*1424dfb3Schristos# NOP - four byte opcode for no-op (defaults to 0) 9*1424dfb3Schristos# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start 10*1424dfb3Schristos# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ... 11*1424dfb3Schristos# (e.g., .PARISC.global) 12*1424dfb3Schristos# OTHER_SECTIONS - at the end 13*1424dfb3Schristos# EXECUTABLE_SYMBOLS - symbols that must be defined for an 14*1424dfb3Schristos# executable (e.g., _DYNAMIC_LINK) 15*1424dfb3Schristos# TEXT_START_SYMBOLS - symbols that appear at the start of the 16*1424dfb3Schristos# .text section. 17*1424dfb3Schristos# DATA_START_SYMBOLS - symbols that appear at the start of the 18*1424dfb3Schristos# .data section. 19*1424dfb3Schristos# OTHER_BSS_SYMBOLS - symbols that appear at the start of the 20*1424dfb3Schristos# .bss section besides __bss_start. 21*1424dfb3Schristos# EMBEDDED - whether this is for an embedded system. 22*1424dfb3Schristos# 23*1424dfb3Schristos# When adding sections, do note that the names of some sections are used 24*1424dfb3Schristos# when specifying the start address of the next. 25*1424dfb3Schristos 26*1424dfb3Schristostest -z "$ENTRY" && ENTRY=_start 27*1424dfb3Schristostest -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT} 28*1424dfb3Schristostest -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} 29*1424dfb3Schristosif [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi 30*1424dfb3Schristostest "$LD_FLAG" = "N" && DATA_ADDR=. 31*1424dfb3Schristos 32*1424dfb3SchristosCTOR=".ctors ${CONSTRUCTING-0} : 33*1424dfb3Schristos { 34*1424dfb3Schristos ${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); } 35*1424dfb3Schristos ${CONSTRUCTING+${CTOR_START}} 36*1424dfb3Schristos KEEP (*(.ctors)) 37*1424dfb3Schristos 38*1424dfb3Schristos ${CONSTRUCTING+${CTOR_END}} 39*1424dfb3Schristos ${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); } 40*1424dfb3Schristos } ${RELOCATING+ > ${TEXT_MEMORY}}" 41*1424dfb3Schristos 42*1424dfb3SchristosDTOR=" .dtors ${CONSTRUCTING-0} : 43*1424dfb3Schristos { 44*1424dfb3Schristos ${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); } 45*1424dfb3Schristos KEEP (*(.dtors)) 46*1424dfb3Schristos ${CONSTRUCTING+ PROVIDE(__DTOR_END__ = .); } 47*1424dfb3Schristos } ${RELOCATING+ > ${TEXT_MEMORY}}" 48*1424dfb3Schristos 49*1424dfb3Schristos 50*1424dfb3SchristosVECTORS=" 51*1424dfb3Schristos /* If the 'vectors_addr' symbol is defined, it indicates the start address 52*1424dfb3Schristos of interrupt vectors. This depends on the 68HC11 operating mode: 53*1424dfb3Schristos 54*1424dfb3Schristos Addr 55*1424dfb3Schristos Single chip 0xffc0 56*1424dfb3Schristos Extended mode 0xffc0 57*1424dfb3Schristos Bootstrap 0x00c0 58*1424dfb3Schristos Test 0xbfc0 59*1424dfb3Schristos 60*1424dfb3Schristos In general, the vectors address is 0xffc0. This can be overriden 61*1424dfb3Schristos with the '-defsym vectors_addr=0xbfc0' ld option. 62*1424dfb3Schristos 63*1424dfb3Schristos Note: for the bootstrap mode, the interrupt vectors are at 0xbfc0 but 64*1424dfb3Schristos they are redirected to 0x00c0 by the internal PROM. Application's vectors 65*1424dfb3Schristos must also consist of jump instructions (see Motorola's manual). */ 66*1424dfb3Schristos 67*1424dfb3Schristos PROVIDE (_vectors_addr = DEFINED (vectors_addr) ? vectors_addr : 0xffc0); 68*1424dfb3Schristos .vectors DEFINED (vectors_addr) ? vectors_addr : 0xffc0 : 69*1424dfb3Schristos { 70*1424dfb3Schristos KEEP (*(.vectors)) 71*1424dfb3Schristos }" 72*1424dfb3Schristos 73*1424dfb3Schristos# 74*1424dfb3Schristos# We provide two emulations: a fixed on that defines some memory banks 75*1424dfb3Schristos# and a configurable one that includes a user provided memory definition. 76*1424dfb3Schristos# 77*1424dfb3Schristoscase $GENERIC_BOARD in 78*1424dfb3Schristos yes|1|YES) 79*1424dfb3Schristos MEMORY_DEF=" 80*1424dfb3Schristos/* Get memory banks definition from some user configuration file. 81*1424dfb3Schristos This file must be located in some linker directory (search path 82*1424dfb3Schristos with -L<dir>). See fixed memory banks emulation script. */ 83*1424dfb3SchristosINCLUDE memory.x; 84*1424dfb3Schristos" 85*1424dfb3Schristos ;; 86*1424dfb3Schristos *) 87*1424dfb3SchristosMEMORY_DEF=" 88*1424dfb3Schristos/* Fixed definition of the available memory banks. 89*1424dfb3Schristos See generic emulation script for a user defined configuration. */ 90*1424dfb3SchristosMEMORY 91*1424dfb3Schristos{ 92*1424dfb3Schristos page0 (rwx) : ORIGIN = 0x0, LENGTH = 256 93*1424dfb3Schristos text (rx) : ORIGIN = ${ROM_START_ADDR}, LENGTH = ${ROM_SIZE} 94*1424dfb3Schristos data : ORIGIN = ${RAM_START_ADDR}, LENGTH = ${RAM_SIZE} 95*1424dfb3Schristos eeprom : ORIGIN = ${EEPROM_START_ADDR}, LENGTH = ${EEPROM_SIZE} 96*1424dfb3Schristos} 97*1424dfb3Schristos 98*1424dfb3Schristos/* Setup the stack on the top of the data memory bank. */ 99*1424dfb3SchristosPROVIDE (_stack = ${RAM_START_ADDR} + ${RAM_SIZE} - 1); 100*1424dfb3Schristos" 101*1424dfb3Schristos ;; 102*1424dfb3Schristosesac 103*1424dfb3Schristos 104*1424dfb3SchristosSTARTUP_CODE=" 105*1424dfb3Schristos /* Startup code. */ 106*1424dfb3Schristos KEEP (*(.install0)) /* Section should setup the stack pointer. */ 107*1424dfb3Schristos KEEP (*(.install1)) /* Place holder for applications. */ 108*1424dfb3Schristos KEEP (*(.install2)) /* Optional installation of data sections in RAM. */ 109*1424dfb3Schristos KEEP (*(.install3)) /* Place holder for applications. */ 110*1424dfb3Schristos KEEP (*(.install4)) /* Section that calls the main. */ 111*1424dfb3Schristos" 112*1424dfb3Schristos 113*1424dfb3SchristosFINISH_CODE=" 114*1424dfb3Schristos /* Finish code. */ 115*1424dfb3Schristos KEEP (*(.fini0)) /* Beginning of finish code (_exit symbol). */ 116*1424dfb3Schristos KEEP (*(.fini1)) /* Place holder for applications. */ 117*1424dfb3Schristos KEEP (*(.fini2)) /* C++ destructors. */ 118*1424dfb3Schristos KEEP (*(.fini3)) /* Place holder for applications. */ 119*1424dfb3Schristos KEEP (*(.fini4)) /* Runtime exit. */ 120*1424dfb3Schristos" 121*1424dfb3Schristos 122*1424dfb3SchristosPRE_COMPUTE_DATA_SIZE=" 123*1424dfb3Schristos/* SCz: this does not work yet... This is supposed to force the loading 124*1424dfb3Schristos of _map_data.o (from libgcc.a) when the .data section is not empty. 125*1424dfb3Schristos By doing so, this should bring the code that copies the .data section 126*1424dfb3Schristos from ROM to RAM at init time. 127*1424dfb3Schristos 128*1424dfb3Schristos ___pre_comp_data_size = SIZEOF(.data); 129*1424dfb3Schristos __install_data_sections = ___pre_comp_data_size > 0 ? 130*1424dfb3Schristos __map_data_sections : 0; 131*1424dfb3Schristos*/ 132*1424dfb3Schristos" 133*1424dfb3Schristos 134*1424dfb3SchristosINSTALL_RELOC=" 135*1424dfb3Schristos .install0 0 : { *(.install0) } 136*1424dfb3Schristos .install1 0 : { *(.install1) } 137*1424dfb3Schristos .install2 0 : { *(.install2) } 138*1424dfb3Schristos .install3 0 : { *(.install3) } 139*1424dfb3Schristos .install4 0 : { *(.install4) } 140*1424dfb3Schristos" 141*1424dfb3Schristos 142*1424dfb3SchristosFINISH_RELOC=" 143*1424dfb3Schristos .fini0 0 : { *(.fini0) } 144*1424dfb3Schristos .fini1 0 : { *(.fini1) } 145*1424dfb3Schristos .fini2 0 : { *(.fini2) } 146*1424dfb3Schristos .fini3 0 : { *(.fini3) } 147*1424dfb3Schristos .fini4 0 : { *(.fini4) } 148*1424dfb3Schristos" 149*1424dfb3Schristos 150*1424dfb3SchristosBSS_DATA_RELOC=" 151*1424dfb3Schristos .data1 0 : { *(.data1) } 152*1424dfb3Schristos 153*1424dfb3Schristos /* We want the small data sections together, so single-instruction offsets 154*1424dfb3Schristos can access them all, and initialized data all before uninitialized, so 155*1424dfb3Schristos we can shorten the on-disk segment size. */ 156*1424dfb3Schristos .sdata 0 : { *(.sdata) } 157*1424dfb3Schristos .sbss 0 : { *(.sbss) } 158*1424dfb3Schristos .scommon 0 : { *(.scommon) } 159*1424dfb3Schristos" 160*1424dfb3Schristos 161*1424dfb3SchristosSOFT_REGS_RELOC=" 162*1424dfb3Schristos .softregs 0 : { *(.softregs) } 163*1424dfb3Schristos" 164*1424dfb3Schristos 165*1424dfb3Schristoscat <<EOF 166*1424dfb3Schristos/* Copyright (C) 2014-2020 Free Software Foundation, Inc. 167*1424dfb3Schristos 168*1424dfb3Schristos Copying and distribution of this script, with or without modification, 169*1424dfb3Schristos are permitted in any medium without royalty provided the copyright 170*1424dfb3Schristos notice and this notice are preserved. */ 171*1424dfb3Schristos 172*1424dfb3Schristos${RELOCATING+/* Linker script for 68HC11 executable (PROM). */} 173*1424dfb3Schristos${RELOCATING-/* Linker script for 68HC11 object file (ld -r). */} 174*1424dfb3Schristos 175*1424dfb3SchristosOUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", 176*1424dfb3Schristos "${LITTLE_OUTPUT_FORMAT}") 177*1424dfb3SchristosOUTPUT_ARCH(${OUTPUT_ARCH}) 178*1424dfb3Schristos${RELOCATING+ENTRY(${ENTRY})} 179*1424dfb3Schristos 180*1424dfb3Schristos${RELOCATING+${LIB_SEARCH_DIRS}} 181*1424dfb3Schristos${RELOCATING+${EXECUTABLE_SYMBOLS}} 182*1424dfb3Schristos${RELOCATING+${MEMORY_DEF}} 183*1424dfb3Schristos 184*1424dfb3SchristosSECTIONS 185*1424dfb3Schristos{ 186*1424dfb3Schristos .hash ${RELOCATING-0} : { *(.hash) } 187*1424dfb3Schristos .dynsym ${RELOCATING-0} : { *(.dynsym) } 188*1424dfb3Schristos .dynstr ${RELOCATING-0} : { *(.dynstr) } 189*1424dfb3Schristos .gnu.version ${RELOCATING-0} : { *(.gnu.version) } 190*1424dfb3Schristos .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) } 191*1424dfb3Schristos .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) } 192*1424dfb3Schristos 193*1424dfb3Schristos .rel.text ${RELOCATING-0} : 194*1424dfb3Schristos { 195*1424dfb3Schristos *(.rel.text) 196*1424dfb3Schristos ${RELOCATING+*(.rel.text.*)} 197*1424dfb3Schristos ${RELOCATING+*(.rel.gnu.linkonce.t.*)} 198*1424dfb3Schristos } 199*1424dfb3Schristos .rela.text ${RELOCATING-0} : 200*1424dfb3Schristos { 201*1424dfb3Schristos *(.rela.text) 202*1424dfb3Schristos ${RELOCATING+*(.rela.text.*)} 203*1424dfb3Schristos ${RELOCATING+*(.rela.gnu.linkonce.t.*)} 204*1424dfb3Schristos } 205*1424dfb3Schristos .rel.data ${RELOCATING-0} : 206*1424dfb3Schristos { 207*1424dfb3Schristos *(.rel.data) 208*1424dfb3Schristos ${RELOCATING+*(.rel.data.*)} 209*1424dfb3Schristos ${RELOCATING+*(.rel.gnu.linkonce.d.*)} 210*1424dfb3Schristos } 211*1424dfb3Schristos .rela.data ${RELOCATING-0} : 212*1424dfb3Schristos { 213*1424dfb3Schristos *(.rela.data) 214*1424dfb3Schristos ${RELOCATING+*(.rela.data.*)} 215*1424dfb3Schristos ${RELOCATING+*(.rela.gnu.linkonce.d.*)} 216*1424dfb3Schristos } 217*1424dfb3Schristos .rel.rodata ${RELOCATING-0} : 218*1424dfb3Schristos { 219*1424dfb3Schristos *(.rel.rodata) 220*1424dfb3Schristos ${RELOCATING+*(.rel.rodata.*)} 221*1424dfb3Schristos ${RELOCATING+*(.rel.gnu.linkonce.r.*)} 222*1424dfb3Schristos } 223*1424dfb3Schristos .rela.rodata ${RELOCATING-0} : 224*1424dfb3Schristos { 225*1424dfb3Schristos *(.rela.rodata) 226*1424dfb3Schristos ${RELOCATING+*(.rela.rodata.*)} 227*1424dfb3Schristos ${RELOCATING+*(.rela.gnu.linkonce.r.*)} 228*1424dfb3Schristos } 229*1424dfb3Schristos .rel.sdata ${RELOCATING-0} : 230*1424dfb3Schristos { 231*1424dfb3Schristos *(.rel.sdata) 232*1424dfb3Schristos ${RELOCATING+*(.rel.sdata.*)} 233*1424dfb3Schristos ${RELOCATING+*(.rel.gnu.linkonce.s.*)} 234*1424dfb3Schristos } 235*1424dfb3Schristos .rela.sdata ${RELOCATING-0} : 236*1424dfb3Schristos { 237*1424dfb3Schristos *(.rela.sdata) 238*1424dfb3Schristos ${RELOCATING+*(.rela.sdata.*)} 239*1424dfb3Schristos ${RELOCATING+*(.rela.gnu.linkonce.s.*)} 240*1424dfb3Schristos } 241*1424dfb3Schristos .rel.sbss ${RELOCATING-0} : 242*1424dfb3Schristos { 243*1424dfb3Schristos *(.rel.sbss) 244*1424dfb3Schristos ${RELOCATING+*(.rel.sbss.*)} 245*1424dfb3Schristos ${RELOCATING+*(.rel.gnu.linkonce.sb.*)} 246*1424dfb3Schristos } 247*1424dfb3Schristos .rela.sbss ${RELOCATING-0} : 248*1424dfb3Schristos { 249*1424dfb3Schristos *(.rela.sbss) 250*1424dfb3Schristos ${RELOCATING+*(.rela.sbss.*)} 251*1424dfb3Schristos ${RELOCATING+*(.rel.gnu.linkonce.sb.*)} 252*1424dfb3Schristos } 253*1424dfb3Schristos .rel.bss ${RELOCATING-0} : 254*1424dfb3Schristos { 255*1424dfb3Schristos *(.rel.bss) 256*1424dfb3Schristos ${RELOCATING+*(.rel.bss.*)} 257*1424dfb3Schristos ${RELOCATING+*(.rel.gnu.linkonce.b.*)} 258*1424dfb3Schristos } 259*1424dfb3Schristos .rela.bss ${RELOCATING-0} : 260*1424dfb3Schristos { 261*1424dfb3Schristos *(.rela.bss) 262*1424dfb3Schristos ${RELOCATING+*(.rela.bss.*)} 263*1424dfb3Schristos ${RELOCATING+*(.rela.gnu.linkonce.b.*)} 264*1424dfb3Schristos } 265*1424dfb3Schristos .rel.stext ${RELOCATING-0} : { *(.rel.stest) } 266*1424dfb3Schristos .rela.stext ${RELOCATING-0} : { *(.rela.stest) } 267*1424dfb3Schristos .rel.etext ${RELOCATING-0} : { *(.rel.etest) } 268*1424dfb3Schristos .rela.etext ${RELOCATING-0} : { *(.rela.etest) } 269*1424dfb3Schristos .rel.sdata ${RELOCATING-0} : { *(.rel.sdata) } 270*1424dfb3Schristos .rela.sdata ${RELOCATING-0} : { *(.rela.sdata) } 271*1424dfb3Schristos .rel.edata ${RELOCATING-0} : { *(.rel.edata) } 272*1424dfb3Schristos .rela.edata ${RELOCATING-0} : { *(.rela.edata) } 273*1424dfb3Schristos .rel.eit_v ${RELOCATING-0} : { *(.rel.eit_v) } 274*1424dfb3Schristos .rela.eit_v ${RELOCATING-0} : { *(.rela.eit_v) } 275*1424dfb3Schristos .rel.ebss ${RELOCATING-0} : { *(.rel.ebss) } 276*1424dfb3Schristos .rela.ebss ${RELOCATING-0} : { *(.rela.ebss) } 277*1424dfb3Schristos .rel.srodata ${RELOCATING-0} : { *(.rel.srodata) } 278*1424dfb3Schristos .rela.srodata ${RELOCATING-0} : { *(.rela.srodata) } 279*1424dfb3Schristos .rel.erodata ${RELOCATING-0} : { *(.rel.erodata) } 280*1424dfb3Schristos .rela.erodata ${RELOCATING-0} : { *(.rela.erodata) } 281*1424dfb3Schristos .rel.got ${RELOCATING-0} : { *(.rel.got) } 282*1424dfb3Schristos .rela.got ${RELOCATING-0} : { *(.rela.got) } 283*1424dfb3Schristos .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) } 284*1424dfb3Schristos .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) } 285*1424dfb3Schristos .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) } 286*1424dfb3Schristos .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) } 287*1424dfb3Schristos .rel.init ${RELOCATING-0} : { *(.rel.init) } 288*1424dfb3Schristos .rela.init ${RELOCATING-0} : { *(.rela.init) } 289*1424dfb3Schristos .rel.fini ${RELOCATING-0} : { *(.rel.fini) } 290*1424dfb3Schristos .rela.fini ${RELOCATING-0} : { *(.rela.fini) } 291*1424dfb3Schristos .rel.plt ${RELOCATING-0} : { *(.rel.plt) } 292*1424dfb3Schristos .rela.plt ${RELOCATING-0} : { *(.rela.plt) } 293*1424dfb3Schristos 294*1424dfb3Schristos /* Concatenate .page0 sections. Put them in the page0 memory bank 295*1424dfb3Schristos unless we are creating a relocatable file. */ 296*1424dfb3Schristos .page0 : 297*1424dfb3Schristos { 298*1424dfb3Schristos *(.page0) 299*1424dfb3Schristos ${RELOCATING+*(.softregs)} 300*1424dfb3Schristos } ${RELOCATING+ > page0} 301*1424dfb3Schristos 302*1424dfb3Schristos /* Start of text section. */ 303*1424dfb3Schristos .stext ${RELOCATING-0} : 304*1424dfb3Schristos { 305*1424dfb3Schristos *(.stext) 306*1424dfb3Schristos } ${RELOCATING+ > ${TEXT_MEMORY}} 307*1424dfb3Schristos 308*1424dfb3Schristos .init ${RELOCATING-0} : 309*1424dfb3Schristos { 310*1424dfb3Schristos KEEP (*(SORT_NONE(.init))) 311*1424dfb3Schristos } ${RELOCATING+=${NOP-0}} 312*1424dfb3Schristos 313*1424dfb3Schristos ${RELOCATING-${INSTALL_RELOC}} 314*1424dfb3Schristos ${RELOCATING-${FINISH_RELOC}} 315*1424dfb3Schristos 316*1424dfb3Schristos .text ${RELOCATING-0}: 317*1424dfb3Schristos { 318*1424dfb3Schristos /* Put startup code at beginning so that _start keeps same address. */ 319*1424dfb3Schristos ${RELOCATING+${STARTUP_CODE}} 320*1424dfb3Schristos 321*1424dfb3Schristos *(.text) 322*1424dfb3Schristos ${RELOCATING+*(.text.*)} 323*1424dfb3Schristos /* .gnu.warning sections are handled specially by elf.em. */ 324*1424dfb3Schristos *(.gnu.warning) 325*1424dfb3Schristos ${RELOCATING+*(.gnu.linkonce.t.*)} 326*1424dfb3Schristos ${RELOCATING+*(.tramp)} 327*1424dfb3Schristos ${RELOCATING+*(.tramp.*)} 328*1424dfb3Schristos 329*1424dfb3Schristos ${RELOCATING+KEEP (*(SORT_NONE(.fini)))} 330*1424dfb3Schristos ${RELOCATING+${FINISH_CODE}} 331*1424dfb3Schristos 332*1424dfb3Schristos ${RELOCATING+_etext = .;} 333*1424dfb3Schristos ${RELOCATING+PROVIDE (etext = .);} 334*1424dfb3Schristos 335*1424dfb3Schristos } ${RELOCATING+ > ${TEXT_MEMORY}} 336*1424dfb3Schristos 337*1424dfb3Schristos .eh_frame ${RELOCATING-0} : 338*1424dfb3Schristos { 339*1424dfb3Schristos KEEP (*(.eh_frame)) 340*1424dfb3Schristos } ${RELOCATING+ > ${TEXT_MEMORY}} 341*1424dfb3Schristos 342*1424dfb3Schristos .gcc_except_table ${RELOCATING-0} : 343*1424dfb3Schristos { 344*1424dfb3Schristos *(.gcc_except_table) 345*1424dfb3Schristos } ${RELOCATING+ > ${TEXT_MEMORY}} 346*1424dfb3Schristos 347*1424dfb3Schristos .rodata ${RELOCATING-0} : 348*1424dfb3Schristos { 349*1424dfb3Schristos *(.rodata) 350*1424dfb3Schristos ${RELOCATING+*(.rodata.*)} 351*1424dfb3Schristos ${RELOCATING+*(.gnu.linkonce.r*)} 352*1424dfb3Schristos } ${RELOCATING+ > ${TEXT_MEMORY}} 353*1424dfb3Schristos 354*1424dfb3Schristos .rodata1 ${RELOCATING-0} : 355*1424dfb3Schristos { 356*1424dfb3Schristos *(.rodata1) 357*1424dfb3Schristos } ${RELOCATING+ > ${TEXT_MEMORY}} 358*1424dfb3Schristos 359*1424dfb3Schristos /* Constructor and destructor tables are in ROM. */ 360*1424dfb3Schristos ${RELOCATING+${CTOR}} 361*1424dfb3Schristos ${RELOCATING+${DTOR}} 362*1424dfb3Schristos 363*1424dfb3Schristos .jcr ${RELOCATING-0} : 364*1424dfb3Schristos { 365*1424dfb3Schristos KEEP (*(.jcr)) 366*1424dfb3Schristos } ${RELOCATING+ > ${TEXT_MEMORY}} 367*1424dfb3Schristos 368*1424dfb3Schristos /* Start of the data section image in ROM. */ 369*1424dfb3Schristos ${RELOCATING+__data_image = .;} 370*1424dfb3Schristos ${RELOCATING+PROVIDE (__data_image = .);} 371*1424dfb3Schristos 372*1424dfb3Schristos /* All read-only sections that normally go in PROM must be above. 373*1424dfb3Schristos We construct the DATA image section in PROM at end of all these 374*1424dfb3Schristos read-only sections. The data image must be copied at init time. 375*1424dfb3Schristos Refer to GNU ld, Section 3.6.8.2 Output Section LMA. */ 376*1424dfb3Schristos .data ${RELOCATING-0} : ${RELOCATING+AT (__data_image)} 377*1424dfb3Schristos { 378*1424dfb3Schristos ${RELOCATING+__data_section_start = .;} 379*1424dfb3Schristos ${RELOCATING+PROVIDE (__data_section_start = .);} 380*1424dfb3Schristos 381*1424dfb3Schristos ${RELOCATING+${DATA_START_SYMBOLS}} 382*1424dfb3Schristos ${RELOCATING+*(.sdata)} 383*1424dfb3Schristos *(.data) 384*1424dfb3Schristos ${RELOCATING+*(.data.*)} 385*1424dfb3Schristos ${RELOCATING+*(.data1)} 386*1424dfb3Schristos ${RELOCATING+*(.gnu.linkonce.d.*)} 387*1424dfb3Schristos ${CONSTRUCTING+CONSTRUCTORS} 388*1424dfb3Schristos 389*1424dfb3Schristos ${RELOCATING+_edata = .;} 390*1424dfb3Schristos ${RELOCATING+PROVIDE (edata = .);} 391*1424dfb3Schristos } ${RELOCATING+ > ${DATA_MEMORY}} 392*1424dfb3Schristos 393*1424dfb3Schristos ${RELOCATING+__data_section_size = SIZEOF(.data);} 394*1424dfb3Schristos ${RELOCATING+PROVIDE (__data_section_size = SIZEOF(.data));} 395*1424dfb3Schristos ${RELOCATING+__data_image_end = __data_image + __data_section_size;} 396*1424dfb3Schristos 397*1424dfb3Schristos ${RELOCATING+${PRE_COMPUTE_DATA_SIZE}} 398*1424dfb3Schristos 399*1424dfb3Schristos /* .install ${RELOCATING-0}: 400*1424dfb3Schristos { 401*1424dfb3Schristos . = _data_image_end; 402*1424dfb3Schristos } ${RELOCATING+ > ${TEXT_MEMORY}} */ 403*1424dfb3Schristos 404*1424dfb3Schristos /* Relocation for some bss and data sections. */ 405*1424dfb3Schristos ${RELOCATING-${BSS_DATA_RELOC}} 406*1424dfb3Schristos ${RELOCATING-${SOFT_REGS_RELOC}} 407*1424dfb3Schristos 408*1424dfb3Schristos .bss ${RELOCATING-0} : 409*1424dfb3Schristos { 410*1424dfb3Schristos ${RELOCATING+__bss_start = .;} 411*1424dfb3Schristos ${RELOCATING+*(.sbss)} 412*1424dfb3Schristos ${RELOCATING+*(.scommon)} 413*1424dfb3Schristos ${RELOCATING+*(.dynbss)} 414*1424dfb3Schristos *(.bss) 415*1424dfb3Schristos ${RELOCATING+*(.bss.*)} 416*1424dfb3Schristos ${RELOCATING+*(.gnu.linkonce.b.*)} 417*1424dfb3Schristos ${RELOCATING+*(COMMON)} 418*1424dfb3Schristos ${RELOCATING+PROVIDE (_end = .);} 419*1424dfb3Schristos } ${RELOCATING+ > ${DATA_MEMORY}} 420*1424dfb3Schristos ${RELOCATING+__bss_size = SIZEOF(.bss);} 421*1424dfb3Schristos ${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));} 422*1424dfb3Schristos 423*1424dfb3Schristos .eeprom ${RELOCATING-0} : 424*1424dfb3Schristos { 425*1424dfb3Schristos *(.eeprom) 426*1424dfb3Schristos ${RELOCATING+*(.eeprom.*)} 427*1424dfb3Schristos } ${RELOCATING+ > ${EEPROM_MEMORY}} 428*1424dfb3Schristos 429*1424dfb3Schristos ${RELOCATING+${VECTORS}} 430*1424dfb3Schristos 431*1424dfb3Schristos /* Stabs debugging sections. */ 432*1424dfb3Schristos .stab 0 : { *(.stab) } 433*1424dfb3Schristos .stabstr 0 : { *(.stabstr) } 434*1424dfb3Schristos .stab.excl 0 : { *(.stab.excl) } 435*1424dfb3Schristos .stab.exclstr 0 : { *(.stab.exclstr) } 436*1424dfb3Schristos .stab.index 0 : { *(.stab.index) } 437*1424dfb3Schristos .stab.indexstr 0 : { *(.stab.indexstr) } 438*1424dfb3Schristos 439*1424dfb3Schristos .comment 0 : { *(.comment) } 440*1424dfb3Schristos 441*1424dfb3SchristosEOF 442*1424dfb3Schristos 443*1424dfb3Schristos. $srcdir/scripttempl/DWARF.sc 444*1424dfb3Schristos 445*1424dfb3Schristoscat <<EOF 446*1424dfb3Schristos} 447*1424dfb3SchristosEOF 448