diff options
Diffstat (limited to 'ld/scripttempl/xstormy16.sc')
-rw-r--r-- | ld/scripttempl/xstormy16.sc | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/ld/scripttempl/xstormy16.sc b/ld/scripttempl/xstormy16.sc index 6153c30..01eed5d 100644 --- a/ld/scripttempl/xstormy16.sc +++ b/ld/scripttempl/xstormy16.sc @@ -107,15 +107,14 @@ cat <<EOF OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}", "${LITTLE_OUTPUT_FORMAT}") OUTPUT_ARCH(${OUTPUT_ARCH}) -${RELOCATING+ENTRY(${ENTRY})} +EOF + +test -n "${RELOCATING}" && cat <<EOF +ENTRY(${ENTRY}) -${RELOCATING+${LIB_SEARCH_DIRS}} -${RELOCATING+${EXECUTABLE_SYMBOLS}} -${RELOCATING+${INPUT_FILES}} -${RELOCATING- /* For some reason, the Solaris linker makes bad executables - if gld -r is used and the intermediate file has sections starting - at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld - bug. But for now assigning the zero vmas works. */} +${LIB_SEARCH_DIRS} +${EXECUTABLE_SYMBOLS} +${INPUT_FILES} /* There are two memory regions we care about, one from 0 through 0x7F00 that is RAM and one from 0x8000 up which is ROM. */ @@ -124,7 +123,9 @@ MEMORY RAM (w) : ORIGIN = 0, LENGTH = 0x7F00 ROM (!w) : ORIGIN = 0x8000, LENGTH = 0xFF8000 } +EOF +cat <<EOF SECTIONS { .data ${RELOCATING-0} : @@ -136,7 +137,7 @@ SECTIONS ${RELOCATING+*(.data.*)} ${RELOCATING+*(.gnu.linkonce.d.*)} ${CONSTRUCTING+SORT(CONSTRUCTORS)} - } > RAM + }${RELOCATING+ > RAM} ${RELOCATING+${OTHER_READWRITE_SECTIONS}} ${RELOCATING+${OTHER_GOT_SYMBOLS}} ${RELOCATING+${OTHER_GOT_SECTIONS}} @@ -146,16 +147,16 @@ SECTIONS ${RELOCATING+${OTHER_BSS_SYMBOLS}} .bss ${RELOCATING-0} : { - *(.dynbss) + ${RELOCATING+*(.dynbss)} *(.bss) ${RELOCATING+*(.bss.*)} ${RELOCATING+*(.gnu.linkonce.b.*)} - *(COMMON) + ${RELOCATING+*(COMMON) /* Align here to ensure that the .bss section occupies space up to _end. Align after .bss to ensure correct alignment even if the .bss section disappears because there are no input sections. */ - ${RELOCATING+. = ALIGN(${ALIGNMENT});} - } > RAM + . = ALIGN(${ALIGNMENT});} + }${RELOCATING+ > RAM} ${RELOCATING+${OTHER_BSS_END_SYMBOLS}} ${RELOCATING+. = ALIGN(${ALIGNMENT});} ${RELOCATING+${OTHER_END_SYMBOLS}} @@ -164,15 +165,15 @@ SECTIONS ${RELOCATING+PROVIDE (end = .);} /* Read-only sections in ROM. */ - .int_vec ${RELOCATING-0} : { *(.int_vec) } ${RELOCATING+> ROM} + .int_vec ${RELOCATING-0} : { *(.int_vec) }${RELOCATING+ > ROM} - .rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} } ${RELOCATING+> ROM} + .rodata ${RELOCATING-0} : { *(.rodata) ${RELOCATING+*(.rodata.*)} ${RELOCATING+*(.gnu.linkonce.r.*)} }${RELOCATING+ > ROM} ${RELOCATING+${CTOR}} ${RELOCATING+${DTOR}} - .jcr : { KEEP (*(.jcr)) } ${RELOCATING+> ROM} - .eh_frame : { KEEP (*(.eh_frame)) } ${RELOCATING+> ROM} - .gcc_except_table : { *(.gcc_except_table) *(.gcc_except_table.*) } ${RELOCATING+> ROM} - .plt : { *(.plt) } ${RELOCATING+> ROM} + .jcr : { KEEP (*(.jcr)) }${RELOCATING+ > ROM} + .eh_frame : { KEEP (*(.eh_frame)) }${RELOCATING+ > ROM} + .gcc_except_table : { *(.gcc_except_table)${RELOCATING+ *(.gcc_except_table.*)} }${RELOCATING+ > ROM} + .plt : { *(.plt) }${RELOCATING+ > ROM} .text ${RELOCATING-0} : { @@ -184,19 +185,19 @@ SECTIONS *(.gnu.warning) ${RELOCATING+*(.gnu.linkonce.t.*)} ${RELOCATING+${OTHER_TEXT_SECTIONS}} - } ${RELOCATING+> ROM =${NOP-0}} + }${RELOCATING+ > ROM =${NOP-0}} .init ${RELOCATING-0} : { ${RELOCATING+${INIT_START}} KEEP (*(.init)) ${RELOCATING+${INIT_END}} - } ${RELOCATING+> ROM =${NOP-0}} + }${RELOCATING+ > ROM =${NOP-0}} .fini ${RELOCATING-0} : { ${RELOCATING+${FINI_START}} KEEP (*(.fini)) ${RELOCATING+${FINI_END}} - } ${RELOCATING+> ROM =${NOP-0}} + }${RELOCATING+ > ROM =${NOP-0}} ${RELOCATING+PROVIDE (__etext = .);} ${RELOCATING+PROVIDE (_etext = .);} ${RELOCATING+PROVIDE (etext = .);} |