From: Hans-Peter Nilsson Date: Wed, 29 Jul 2009 00:25:22 +0000 (+0000) Subject: * scripttempl/mmo.sc: For relocateable links, set $OUTPUT_FORMAT to X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=18c32df5b44a1b3e6a5e9600c9a4c4bd731d24f2;p=binutils-gdb.git * scripttempl/mmo.sc: For relocateable links, set $OUTPUT_FORMAT to the new $RELOCATEABLE_OUTPUT_FORMAT, if set. (OUTPUT_FORMAT): Use the variable $OUTPUT_FORMAT. (ENTRY): Don't emit for relocateable links. (/DISCARD/): Don't discard .gnu.warning.* for relocateable links. * emulparams/mmo.sh (RELOCATEABLE_OUTPUT_FORMAT): Set, to elf64-mmix. * emulparams/elf64mmix.sh (OTHER_TEXT_SECTIONS): Empty, don't provide "Main" or set "_start.", for relocateable links. --- diff --git a/ld/ChangeLog b/ld/ChangeLog index 89c4632e472..d9ec3bad621 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,15 @@ +2009-07-29 Hans-Peter Nilsson + + * scripttempl/mmo.sc: For relocateable links, set $OUTPUT_FORMAT to + the new $RELOCATEABLE_OUTPUT_FORMAT, if set. + (OUTPUT_FORMAT): Use the variable $OUTPUT_FORMAT. + (ENTRY): Don't emit for relocateable links. + (/DISCARD/): Don't discard .gnu.warning.* for relocateable links. + * emulparams/mmo.sh (RELOCATEABLE_OUTPUT_FORMAT): Set, to + elf64-mmix. + * emulparams/elf64mmix.sh (OTHER_TEXT_SECTIONS): Empty, don't + provide "Main" or set "_start.", for relocateable links. + 2009-07-27 Nick Clifton * (po/fi.po): Updated Finnish translation. diff --git a/ld/emulparams/elf64mmix.sh b/ld/emulparams/elf64mmix.sh index 787b50d6545..bdb5d0abcd2 100644 --- a/ld/emulparams/elf64mmix.sh +++ b/ld/emulparams/elf64mmix.sh @@ -35,11 +35,14 @@ EXTRA_EM_FILE=mmixelf # DEFINED wouldn't find the symbol if it was at the top; presumably # before the definition, if the definition is not in the first file. # FIXME: Arguably a linker bug. -OTHER_TEXT_SECTIONS=' +# Only do this for a final link, or else we'll mess up e.g. error +# messages. +OTHER_TEXT_SECTIONS=" +${RELOCATING+ _start. = (DEFINED (_start) ? _start : (DEFINED (Main) ? Main : (DEFINED (.text) ? .text : 0))); PROVIDE (Main = DEFINED (Main) ? Main : (DEFINED (_start) ? _start : _start.)); -' +}" OTHER_SECTIONS=' .MMIX.reg_contents : diff --git a/ld/emulparams/mmo.sh b/ld/emulparams/mmo.sh index e0a87981145..ca98013cafc 100644 --- a/ld/emulparams/mmo.sh +++ b/ld/emulparams/mmo.sh @@ -5,6 +5,7 @@ TARGET_PAGE_SIZE=256 TEXT_START_ADDR='DEFINED (__.MMIX.start..text) ? __.MMIX.start..text : 0' DATA_ADDR='DEFINED (__.MMIX.start..data) ? __.MMIX.start..data : 0x2000000000000000' OUTPUT_FORMAT=mmo +RELOCATEABLE_OUTPUT_FORMAT=elf64-mmix ARCH=mmix COMPILE_IN=yes EXTRA_EM_FILE=mmo diff --git a/ld/scripttempl/mmo.sc b/ld/scripttempl/mmo.sc index 599db83199d..33808846ac7 100644 --- a/ld/scripttempl/mmo.sc +++ b/ld/scripttempl/mmo.sc @@ -1,7 +1,11 @@ +# MMO is not a relocateable format, and we don't want to require an +# explicit (e.g.) "-m elf64mmix" when -r is used. +test -z $RELOCATEABLE_OUTPUT_FORMAT && RELOCATEABLE_OUTPUT_FORMAT=$OUTPUT_FORMAT +test -z ${RELOCATING+0} && OUTPUT_FORMAT=$RELOCATEABLE_OUTPUT_FORMAT cat <