This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Commit: MN10300: Fix relaxation of "mov imm32, An" instructions


Hi Guys,

  I am applying the patch below to fix a problem with MN10300 linker's
  relaxation of "mov imm32, An" instructions.  The test to stop this
  relaxation when the value is negative (since the 16-bit version of the
  instruction zero-extends rather than sign-extends) was not correctly
  masking out the address register bits.

  Tested by building and running the G++ testsuite for an mn10300-elf
  toolchain, both with and without relaxation enabled.

Cheers
  Nick

bfd/ChangeLog
2011-11-08  Nick Clifton  <nickc@redhat.com>

	* elf-m10300.c (mn10300_elf_relax_section): Fix check for an
	immediate move into an address register.

Index: bfd/elf-m10300.c
===================================================================
RCS file: /cvs/src/src/bfd/elf-m10300.c,v
retrieving revision 1.109
diff -u -3 -p -r1.109 elf-m10300.c
--- bfd/elf-m10300.c	19 Oct 2011 07:17:19 -0000	1.109
+++ bfd/elf-m10300.c	8 Nov 2011 15:03:15 -0000
@@ -3604,8 +3604,8 @@ mn10300_elf_relax_section (bfd *abfd,
 			&& (value & 0x8000))
 		      continue;
 
-		    /* mov imm16, an zero-extends the immediate.  */
-		    if (code == 0xdc
+		    /* "mov imm16, an" zero-extends the immediate.  */
+		    if ((code & 0xfc) == 0xdc
 			&& (long) value < 0)
 		      continue;
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]