PR 6844
[binutils-gdb.git] / bfd / elf32-cr16.c
index d0f7fd19bdb5a9ff456a0db727263d40c4529b40..84130b0caa4b6adc42816a9996bbec1e81e6b881 100644 (file)
@@ -1337,7 +1337,7 @@ elf32_cr16_relax_section (bfd *abfd, asection *sec,
 
               /* Verify it's a arithmetic ADDD or MOVD instruction.
                  For ADDD and MOVD only, convert to IMM32 -> IMM20.  */
-              if (((code & 0xfff0) != 0x0070) || ((code & 0xfff0) != 0x0020))
+              if (((code & 0xfff0) == 0x0070) || ((code & 0xfff0) == 0x0020))
                 is_add_mov = 1;
 
               if (is_add_mov)
@@ -1568,6 +1568,7 @@ elf32_cr16_gc_sweep_hook (bfd *abfd ATTRIBUTE_UNUSED,
 #define TARGET_LITTLE_NAME                "elf32-cr16"
 #define ELF_ARCH                          bfd_arch_cr16
 #define ELF_MACHINE_CODE                  EM_CR16
+#define ELF_MACHINE_ALT1                  EM_CR16_OLD
 #define ELF_MAXPAGESIZE                   0x1
 #define elf_symbol_leading_char           '_'