X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=ld%2Fscripttempl%2Felfm68hc11.sc;h=6ccd4d1819c29a6ab4ab980ce28ffb062d6dbc3a;hb=21af24c8371a3e040f6f548ddfafb20114442c28;hp=dc0956e4dada3b8f2966c646a5a6e1041a7c8ad2;hpb=ecfdd20ccea64a0358dfb8896d7cc15f559de389;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/scripttempl/elfm68hc11.sc b/ld/scripttempl/elfm68hc11.sc index dc0956e4da..6ccd4d1819 100644 --- a/ld/scripttempl/elfm68hc11.sc +++ b/ld/scripttempl/elfm68hc11.sc @@ -1,3 +1,8 @@ +# Copyright (C) 2014-2020 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved. # # Unusual variables checked by this code: # NOP - four byte opcode for no-op (defaults to 0) @@ -13,30 +18,22 @@ # .data section. # OTHER_BSS_SYMBOLS - symbols that appear at the start of the # .bss section besides __bss_start. -# EMBEDDED - whether this is for an embedded system. +# EMBEDDED - whether this is for an embedded system. # # When adding sections, do note that the names of some sections are used # when specifying the start address of the next. -# + test -z "$ENTRY" && ENTRY=_start test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT} test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT} if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi test "$LD_FLAG" = "N" && DATA_ADDR=. -CTOR=".ctors ${CONSTRUCTING-0} : +CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); } ${CONSTRUCTING+${CTOR_START}} - *(.ctors) - /* We don't want to include the .ctor section from - from the crtend.o file until after the sorted ctors. - The .ctor section from the crtend file contains the - end of ctors marker and it must be last - - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) */ + KEEP (*(.ctors)) ${CONSTRUCTING+${CTOR_END}} ${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); } @@ -45,12 +42,7 @@ CTOR=".ctors ${CONSTRUCTING-0} : DTOR=" .dtors ${CONSTRUCTING-0} : { ${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); } - *(.dtors) - /* - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) */ + KEEP (*(.dtors)) ${CONSTRUCTING+ PROVIDE(__DTOR_END__ = .); } } ${RELOCATING+ > ${TEXT_MEMORY}}" @@ -65,7 +57,7 @@ VECTORS=" Bootstrap 0x00c0 Test 0xbfc0 - In general, the vectors address is 0xffc0. This can be overriden + In general, the vectors address is 0xffc0. This can be overriden with the '-defsym vectors_addr=0xbfc0' ld option. Note: for the bootstrap mode, the interrupt vectors are at 0xbfc0 but @@ -75,7 +67,7 @@ VECTORS=" PROVIDE (_vectors_addr = DEFINED (vectors_addr) ? vectors_addr : 0xffc0); .vectors DEFINED (vectors_addr) ? vectors_addr : 0xffc0 : { - *(.vectors) + KEEP (*(.vectors)) }" # @@ -100,6 +92,7 @@ MEMORY page0 (rwx) : ORIGIN = 0x0, LENGTH = 256 text (rx) : ORIGIN = ${ROM_START_ADDR}, LENGTH = ${ROM_SIZE} data : ORIGIN = ${RAM_START_ADDR}, LENGTH = ${RAM_SIZE} + eeprom : ORIGIN = ${EEPROM_START_ADDR}, LENGTH = ${EEPROM_SIZE} } /* Setup the stack on the top of the data memory bank. */ @@ -110,20 +103,20 @@ esac STARTUP_CODE=" /* Startup code. */ - *(.install0) /* Section should setup the stack pointer. */ - *(.install1) /* Place holder for applications. */ - *(.install2) /* Optional installation of data sections in RAM. */ - *(.install3) /* Place holder for applications. */ - *(.install4) /* Section that calls the main. */ + KEEP (*(.install0)) /* Section should setup the stack pointer. */ + KEEP (*(.install1)) /* Place holder for applications. */ + KEEP (*(.install2)) /* Optional installation of data sections in RAM. */ + KEEP (*(.install3)) /* Place holder for applications. */ + KEEP (*(.install4)) /* Section that calls the main. */ " FINISH_CODE=" /* Finish code. */ - *(.fini0) /* Beginning of finish code (_exit symbol). */ - *(.fini1) /* Place holder for applications. */ - *(.fini2) /* C++ destructors. */ - *(.fini3) /* Place holder for applications. */ - *(.fini4) /* Runtime exit. */ + KEEP (*(.fini0)) /* Beginning of finish code (_exit symbol). */ + KEEP (*(.fini1)) /* Place holder for applications. */ + KEEP (*(.fini2)) /* C++ destructors. */ + KEEP (*(.fini3)) /* Place holder for applications. */ + KEEP (*(.fini4)) /* Runtime exit. */ " PRE_COMPUTE_DATA_SIZE=" @@ -165,14 +158,24 @@ BSS_DATA_RELOC=" .scommon 0 : { *(.scommon) } " +SOFT_REGS_RELOC=" + .softregs 0 : { *(.softregs) } +" + cat < page0} /* Start of text section. */ - .stext ${RELOCATING-0} : + .stext ${RELOCATING-0} : { *(.stext) } ${RELOCATING+ > ${TEXT_MEMORY}} .init ${RELOCATING-0} : { - *(.init) + KEEP (*(SORT_NONE(.init))) } ${RELOCATING+=${NOP-0}} ${RELOCATING-${INSTALL_RELOC}} @@ -315,13 +318,15 @@ SECTIONS /* Put startup code at beginning so that _start keeps same address. */ ${RELOCATING+${STARTUP_CODE}} - ${RELOCATING+*(.init)} *(.text) ${RELOCATING+*(.text.*)} - /* .gnu.warning sections are handled specially by elf32.em. */ + /* .gnu.warning sections are handled specially by elf.em. */ *(.gnu.warning) ${RELOCATING+*(.gnu.linkonce.t.*)} + ${RELOCATING+*(.tramp)} + ${RELOCATING+*(.tramp.*)} + ${RELOCATING+KEEP (*(SORT_NONE(.fini)))} ${RELOCATING+${FINISH_CODE}} ${RELOCATING+_etext = .;} @@ -334,6 +339,11 @@ SECTIONS KEEP (*(.eh_frame)) } ${RELOCATING+ > ${TEXT_MEMORY}} + .gcc_except_table ${RELOCATING-0} : + { + *(.gcc_except_table) + } ${RELOCATING+ > ${TEXT_MEMORY}} + .rodata ${RELOCATING-0} : { *(.rodata) @@ -393,23 +403,29 @@ SECTIONS /* Relocation for some bss and data sections. */ ${RELOCATING-${BSS_DATA_RELOC}} + ${RELOCATING-${SOFT_REGS_RELOC}} .bss ${RELOCATING-0} : { ${RELOCATING+__bss_start = .;} ${RELOCATING+*(.sbss)} ${RELOCATING+*(.scommon)} - - *(.dynbss) + ${RELOCATING+*(.dynbss)} *(.bss) ${RELOCATING+*(.bss.*)} ${RELOCATING+*(.gnu.linkonce.b.*)} - *(COMMON) + ${RELOCATING+*(COMMON)} ${RELOCATING+PROVIDE (_end = .);} } ${RELOCATING+ > ${DATA_MEMORY}} ${RELOCATING+__bss_size = SIZEOF(.bss);} ${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));} + .eeprom ${RELOCATING-0} : + { + *(.eeprom) + ${RELOCATING+*(.eeprom.*)} + } ${RELOCATING+ > ${EEPROM_MEMORY}} + ${RELOCATING+${VECTORS}} /* Stabs debugging sections. */ @@ -422,33 +438,10 @@ SECTIONS .comment 0 : { *(.comment) } - /* DWARF debug sections. - Symbols in the DWARF debugging sections are relative to the beginning - of the section so we begin them at 0. - Treatment of DWARF debug section must be at end of the linker - script to avoid problems when there are undefined symbols. It's necessary - to avoid that the DWARF section is relocated before such undefined - symbols are found. */ - - /* DWARF 1 */ - .debug 0 : { *(.debug) } - .line 0 : { *(.line) } - - /* GNU DWARF 1 extensions */ - .debug_srcinfo 0 : { *(.debug_srcinfo) } - .debug_sfnames 0 : { *(.debug_sfnames) } - - /* DWARF 1.1 and DWARF 2 */ - .debug_aranges 0 : { *(.debug_aranges) } - .debug_pubnames 0 : { *(.debug_pubnames) } - - /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_line 0 : { *(.debug_line) } - .debug_frame 0 : { *(.debug_frame) } - .debug_str 0 : { *(.debug_str) } - .debug_loc 0 : { *(.debug_loc) } - .debug_macinfo 0 : { *(.debug_macinfo) } +EOF + +. $srcdir/scripttempl/DWARF.sc + +cat <