X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Fscripttempl%2Felfm68hc11.sc;h=6ccd4d1819c29a6ab4ab980ce28ffb062d6dbc3a;hb=6687b129bcfada5ee26e5c34101d21d32ab8c3b0;hp=98187a9eb86dc2d4ac11b8901a6470e952508289;hpb=df381c72f46873ac16530442ac11b160009bcba8;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/scripttempl/elfm68hc11.sc b/ld/scripttempl/elfm68hc11.sc index 98187a9eb8..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,18 +18,18 @@ # .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 : +CTOR=".ctors ${CONSTRUCTING-0} : { ${CONSTRUCTING+ PROVIDE (__CTOR_LIST__ = .); } ${CONSTRUCTING+${CTOR_START}} @@ -34,7 +39,7 @@ CTOR=".ctors : ${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); } } ${RELOCATING+ > ${TEXT_MEMORY}}" -DTOR=" .dtors : +DTOR=" .dtors ${CONSTRUCTING-0} : { ${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); } KEEP (*(.dtors)) @@ -52,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 @@ -127,37 +132,43 @@ PRE_COMPUTE_DATA_SIZE=" " INSTALL_RELOC=" - .install0 : { *(.install0) } - .install1 : { *(.install1) } - .install2 : { *(.install2) } - .install3 : { *(.install3) } - .install4 : { *(.install4) } + .install0 0 : { *(.install0) } + .install1 0 : { *(.install1) } + .install2 0 : { *(.install2) } + .install3 0 : { *(.install3) } + .install4 0 : { *(.install4) } " FINISH_RELOC=" - .fini0 : { *(.fini0) } - .fini1 : { *(.fini1) } - .fini2 : { *(.fini2) } - .fini3 : { *(.fini3) } - .fini4 : { *(.fini4) } + .fini0 0 : { *(.fini0) } + .fini1 0 : { *(.fini1) } + .fini2 0 : { *(.fini2) } + .fini3 0 : { *(.fini3) } + .fini4 0 : { *(.fini4) } " BSS_DATA_RELOC=" - .data1 : { *(.data1) } + .data1 0 : { *(.data1) } /* We want the small data sections together, so single-instruction offsets can access them all, and initialized data all before uninitialized, so we can shorten the on-disk segment size. */ - .sdata : { *(.sdata) } - .sbss : { *(.sbss) } - .scommon : { *(.scommon) } + .sdata 0 : { *(.sdata) } + .sbss 0 : { *(.sbss) } + .scommon 0 : { *(.scommon) } " SOFT_REGS_RELOC=" - .softregs : { *(.softregs) } + .softregs 0 : { *(.softregs) } " cat < page0} /* Start of text section. */ - .stext : + .stext ${RELOCATING-0} : { *(.stext) } ${RELOCATING+ > ${TEXT_MEMORY}} - .init : + .init ${RELOCATING-0} : { - *(.init) + KEEP (*(SORT_NONE(.init))) } ${RELOCATING+=${NOP-0}} ${RELOCATING-${INSTALL_RELOC}} ${RELOCATING-${FINISH_RELOC}} - .text : + .text ${RELOCATING-0}: { /* 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 = .;} @@ -323,24 +334,24 @@ SECTIONS } ${RELOCATING+ > ${TEXT_MEMORY}} - .eh_frame : + .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) } ${RELOCATING+ > ${TEXT_MEMORY}} - .gcc_except_table : + .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) } ${RELOCATING+ > ${TEXT_MEMORY}} - .rodata : + .rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r*)} } ${RELOCATING+ > ${TEXT_MEMORY}} - .rodata1 : + .rodata1 ${RELOCATING-0} : { *(.rodata1) } ${RELOCATING+ > ${TEXT_MEMORY}} @@ -349,7 +360,7 @@ SECTIONS ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} - .jcr : + .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) } ${RELOCATING+ > ${TEXT_MEMORY}} @@ -362,7 +373,7 @@ SECTIONS We construct the DATA image section in PROM at end of all these read-only sections. The data image must be copied at init time. Refer to GNU ld, Section 3.6.8.2 Output Section LMA. */ - .data : ${RELOCATING+AT (__data_image)} + .data ${RELOCATING-0} : ${RELOCATING+AT (__data_image)} { ${RELOCATING+__data_section_start = .;} ${RELOCATING+PROVIDE (__data_section_start = .);} @@ -385,7 +396,7 @@ SECTIONS ${RELOCATING+${PRE_COMPUTE_DATA_SIZE}} - /* .install : + /* .install ${RELOCATING-0}: { . = _data_image_end; } ${RELOCATING+ > ${TEXT_MEMORY}} */ @@ -394,26 +405,25 @@ SECTIONS ${RELOCATING-${BSS_DATA_RELOC}} ${RELOCATING-${SOFT_REGS_RELOC}} - .bss : + .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 : + .eeprom ${RELOCATING-0} : { *(.eeprom) - *(.eeprom.*) + ${RELOCATING+*(.eeprom.*)} } ${RELOCATING+ > ${EEPROM_MEMORY}} ${RELOCATING+${VECTORS}} @@ -428,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 <