]> rtime.felk.cvut.cz Git - fpga/lx-cpu1/binutils-tumbl.git/commitdiff
PR gas/14260
authorNick Clifton <nickc@redhat.com>
Thu, 28 Jun 2012 15:38:12 +0000 (15:38 +0000)
committerNick Clifton <nickc@redhat.com>
Thu, 28 Jun 2012 15:38:12 +0000 (15:38 +0000)
* config/tc-arm.c (encode_arm_addr_mode_common): Generate an error
message if literal pool addressing is used.

* gas/arm/ldr-t-bad.s: Add test of bogus use of literal pool
addressing.
* gas/arm/ldr-t-bad.l: Update expected assembler error message
output.

gas/ChangeLog
gas/config/tc-arm.c
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/ldr-t-bad.l
gas/testsuite/gas/arm/ldr-t-bad.s

index 0d833a9e5fc1017b2f33d955785a0525bf11cef5..111a211ba153fa3c07d451c3371de738d3c12950 100644 (file)
@@ -1,3 +1,9 @@
+2012-06-28  Nick Clifton  <nickc@redhat.com>
+
+       PR gas/14260
+       * config/tc-arm.c (encode_arm_addr_mode_common): Generate an error
+       message if literal pool addressing is used.
+
 2012-06-28  Nick Clifton  <nickc@redhat.com>
 
        * dwarf2dbg.c (DWARF2_USE_FIXED_ADVANCE_PC): Enable when using
index 2257d4e59b8ac0933de9e89ce228ddb4940b7f62..43e20d1ed3b7933ea8fe373fb564a8d3962974a4 100644 (file)
@@ -7042,7 +7042,11 @@ encode_arm_shifter_operand (int i)
 static void
 encode_arm_addr_mode_common (int i, bfd_boolean is_t)
 {
-  gas_assert (inst.operands[i].isreg);
+  /* PR 14260:
+     Generate an error if the operand is not a register.  */
+  constraint (!inst.operands[i].isreg,
+             _("Instruction does not support =N addresses"));
+
   inst.instruction |= inst.operands[i].reg << 16;
 
   if (inst.operands[i].preind)
@@ -21269,8 +21273,8 @@ md_apply_fix (fixS *    fixP,
     thumb_bl_common:
 
 #ifdef OBJ_ELF
-       if (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4 &&
-          fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX)
+       if (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4
+          && fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX)
         fixP->fx_r_type = BFD_RELOC_THUMB_PCREL_BRANCH23;
 #endif
 
@@ -21281,15 +21285,15 @@ md_apply_fix (fixS *  fixP,
           1 of the base address.  */
        value = (value + 1) & ~ 1;
 
-       if ((value & ~0x3fffff) && ((value & ~0x3fffff) != ~0x3fffff))
-        {
-          if (!(ARM_CPU_HAS_FEATURE (cpu_variant, arm_arch_t2)))
-            as_bad_where (fixP->fx_file, fixP->fx_line, BAD_RANGE);
-          else if ((value & ~0x1ffffff)
-                   && ((value & ~0x1ffffff) != ~0x1ffffff))
-            as_bad_where (fixP->fx_file, fixP->fx_line,
-                          _("Thumb2 branch out of range"));
-        }
+      if ((value & ~0x3fffff) && ((value & ~0x3fffff) != ~0x3fffff))
+       {
+         if (!(ARM_CPU_HAS_FEATURE (cpu_variant, arm_arch_t2)))
+           as_bad_where (fixP->fx_file, fixP->fx_line, BAD_RANGE);
+         else if ((value & ~0x1ffffff)
+                  && ((value & ~0x1ffffff) != ~0x1ffffff))
+           as_bad_where (fixP->fx_file, fixP->fx_line,
+                         _("Thumb2 branch out of range"));
+       }
 
       if (fixP->fx_done || !seg->use_rela_p)
        encode_thumb2_b_bl_offset (buf, value);
index d76f013451b456394878a531a5d8d5c3cfa6f801..6e41589a3ccb0a0c6f83b0611f578d1ae91f5057 100644 (file)
@@ -1,3 +1,11 @@
+2012-06-28  Nick Clifton  <nickc@redhat.com>
+
+       PR gas/14260
+       * gas/arm/ldr-t-bad.s: Add test of bogus use of literal pool
+       addressing.
+       * gas/arm/ldr-t-bad.l: Update expected assembler error message
+       output.
+
 2012-06-28  Nick Clifton  <nickc@redhat.com>
 
        * gas/lns/lns.exp: Use alternate lns-common test for targets
index bda9eefa65da3d823aeb0c203bc2e5f4d34dab72..95f420aad8f2130b92e23b58ab93ef0ac86e02b8 100644 (file)
@@ -13,4 +13,4 @@
 [^:]*:56: Error: r15 not allowed here -- `str r15,\[r1,r2\]'
 [^:]*:57: Error: r13 not allowed here -- `str r1,\[r2,r13\]'
 [^:]*:58: Error: r15 not allowed here -- `str r1,\[r2,r15\]'
-
+[^:]*:61: Error: Instruction does not support =N addresses -- `ldrt r0,=0x0'
index ee76a3e3be2ce4ec520fbea96ea5f1becf8ad8b7..81c17a54ebdefaa42076270d04128cf46218405a 100644 (file)
@@ -57,3 +57,5 @@
        str r1, [r2, r13]
        str r1, [r2, r15]
 
+       @ PR 14260
+       ldrt r0, =0x0