X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=ld%2Fscripttempl%2Felfm68hc11.sc;h=a6f2cce853a41c89bc42ca6e14a2b9d67a033c43;hb=43e56c3465048924a6b985e0e75bfe2a7ccaef0e;hp=668fc0aa8728bb51770a9d726046826615c9f5d9;hpb=d0352a18a504a4e7b761f6b3264cf11347d8d056;p=deliverable%2Fbinutils-gdb.git diff --git a/ld/scripttempl/elfm68hc11.sc b/ld/scripttempl/elfm68hc11.sc index 668fc0aa87..a6f2cce853 100644 --- a/ld/scripttempl/elfm68hc11.sc +++ b/ld/scripttempl/elfm68hc11.sc @@ -1,6 +1,6 @@ # # Unusual variables checked by this code: -# NOP - two byte opcode for no-op (defaults to 0) +# NOP - four byte opcode for no-op (defaults to 0) # DATA_ADDR - if end-of-text-plus-one-page isn't right for data start # OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ... # (e.g., .PARISC.global) @@ -26,33 +26,20 @@ test "$LD_FLAG" = "N" && DATA_ADDR=. CTOR=".ctors ${CONSTRUCTING-0} : { - ${CONSTRUCTING+ __CTOR_LIST__ = .; } + ${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+ __CTOR_END__ = .; } - } ${RELOCATING+ > ${DATA_MEMORY}}" + ${CONSTRUCTING+ PROVIDE(__CTOR_END__ = .); } + } ${RELOCATING+ > ${TEXT_MEMORY}}" DTOR=" .dtors ${CONSTRUCTING-0} : { - ${CONSTRUCTING+ __DTOR_LIST__ = .; } - *(.dtors) - /* - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) */ - ${CONSTRUCTING+ __DTOR_END__ = .; } - } ${RELOCATING+ > ${DATA_MEMORY}}" + ${CONSTRUCTING+ PROVIDE(__DTOR_LIST__ = .); } + KEEP (*(.dtors)) + ${CONSTRUCTING+ PROVIDE(__DTOR_END__ = .); } + } ${RELOCATING+ > ${TEXT_MEMORY}}" VECTORS=" @@ -75,7 +62,7 @@ VECTORS=" PROVIDE (_vectors_addr = DEFINED (vectors_addr) ? vectors_addr : 0xffc0); .vectors DEFINED (vectors_addr) ? vectors_addr : 0xffc0 : { - *(.vectors) + KEEP (*(.vectors)) }" # @@ -100,6 +87,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,11 +98,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. */ + 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=" @@ -137,6 +134,14 @@ INSTALL_RELOC=" .install4 0 : { *(.install4) } " +FINISH_RELOC=" + .fini0 0 : { *(.fini0) } + .fini1 0 : { *(.fini1) } + .fini2 0 : { *(.fini2) } + .fini3 0 : { *(.fini3) } + .fini4 0 : { *(.fini4) } +" + BSS_DATA_RELOC=" .data1 0 : { *(.data1) } @@ -148,6 +153,10 @@ BSS_DATA_RELOC=" .scommon 0 : { *(.scommon) } " +SOFT_REGS_RELOC=" + .softregs 0 : { *(.softregs) } +" + cat < page0} /* Start of text section. */ @@ -228,6 +300,7 @@ SECTIONS } ${RELOCATING+=${NOP-0}} ${RELOCATING-${INSTALL_RELOC}} + ${RELOCATING-${FINISH_RELOC}} .text ${RELOCATING-0}: { @@ -236,10 +309,14 @@ SECTIONS ${RELOCATING+*(.init)} *(.text) - *(.fini) + ${RELOCATING+*(.text.*)} /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) - *(.gnu.linkonce.t*) + ${RELOCATING+*(.gnu.linkonce.t.*)} + ${RELOCATING+*(.tramp)} + ${RELOCATING+*(.tramp.*)} + + ${RELOCATING+${FINISH_CODE}} ${RELOCATING+_etext = .;} ${RELOCATING+PROVIDE (etext = .);} @@ -248,13 +325,19 @@ SECTIONS .eh_frame ${RELOCATING-0} : { - *(.eh_frame) + KEEP (*(.eh_frame)) + } ${RELOCATING+ > ${TEXT_MEMORY}} + + .gcc_except_table ${RELOCATING-0} : + { + *(.gcc_except_table) } ${RELOCATING+ > ${TEXT_MEMORY}} .rodata ${RELOCATING-0} : { *(.rodata) - *(.gnu.linkonce.r*) + ${RELOCATING+*(.rodata.*)} + ${RELOCATING+*(.gnu.linkonce.r*)} } ${RELOCATING+ > ${TEXT_MEMORY}} .rodata1 ${RELOCATING-0} : @@ -262,6 +345,15 @@ SECTIONS *(.rodata1) } ${RELOCATING+ > ${TEXT_MEMORY}} + /* Constructor and destructor tables are in ROM. */ + ${RELOCATING+${CTOR}} + ${RELOCATING+${DTOR}} + + .jcr ${RELOCATING-0} : + { + KEEP (*(.jcr)) + } ${RELOCATING+ > ${TEXT_MEMORY}} + /* Start of the data section image in ROM. */ ${RELOCATING+__data_image = .;} ${RELOCATING+PROVIDE (__data_image = .);} @@ -278,8 +370,9 @@ SECTIONS ${RELOCATING+${DATA_START_SYMBOLS}} ${RELOCATING+*(.sdata)} *(.data) + ${RELOCATING+*(.data.*)} ${RELOCATING+*(.data1)} - *(.gnu.linkonce.d*) + ${RELOCATING+*(.gnu.linkonce.d.*)} ${CONSTRUCTING+CONSTRUCTORS} ${RELOCATING+_edata = .;} @@ -299,6 +392,7 @@ SECTIONS /* Relocation for some bss and data sections. */ ${RELOCATING-${BSS_DATA_RELOC}} + ${RELOCATING-${SOFT_REGS_RELOC}} .bss ${RELOCATING-0} : { @@ -308,12 +402,19 @@ SECTIONS *(.dynbss) *(.bss) + ${RELOCATING+*(.bss.*)} + ${RELOCATING+*(.gnu.linkonce.b.*)} *(COMMON) ${RELOCATING+PROVIDE (_end = .);} } ${RELOCATING+ > ${DATA_MEMORY}} + ${RELOCATING+__bss_size = SIZEOF(.bss);} + ${RELOCATING+PROVIDE (__bss_size = SIZEOF(.bss));} - ${RELOCATING+${CTOR}} - ${RELOCATING+${DTOR}} + .eeprom ${RELOCATING-0} : + { + *(.eeprom) + *(.eeprom.*) + } ${RELOCATING+ > ${EEPROM_MEMORY}} ${RELOCATING+${VECTORS}} @@ -348,7 +449,7 @@ SECTIONS .debug_pubnames 0 : { *(.debug_pubnames) } /* DWARF 2 */ - .debug_info 0 : { *(.debug_info) } + .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } .debug_abbrev 0 : { *(.debug_abbrev) } .debug_line 0 : { *(.debug_line) } .debug_frame 0 : { *(.debug_frame) }