include/elf/
[deliverable/binutils-gdb.git] / gas / config / tc-arm.c
index f629ff43585b29a8c3284bc0f75e9ef7ff0d9088..39f1b65495ea29bc13ae72c5e4843ff20b423154 100644 (file)
@@ -2063,8 +2063,8 @@ static void s_thumb_func PARAMS ((int));
 static void s_thumb_set PARAMS ((int));
 static void arm_s_text PARAMS ((int));
 static void arm_s_data PARAMS ((int));
-#ifdef OBJ_ELF
 static void arm_s_section PARAMS ((int));
+#ifdef OBJ_ELF
 static void s_arm_elf_cons PARAMS ((int));
 #endif
 
@@ -2088,11 +2088,11 @@ const pseudo_typeS md_pseudo_table[] =
   /* Allow for the effect of section changes.  */
   { "text",        arm_s_text,    0 },
   { "data",        arm_s_data,    0 },
-#ifdef OBJ_ELF
   { "section",     arm_s_section, 0 },
   { "section.s",   arm_s_section, 0 },
   { "sect",        arm_s_section, 0 },
   { "sect.s",      arm_s_section, 0 },
+#ifdef OBJ_ELF
   { "word",        s_arm_elf_cons, 4 },
   { "long",        s_arm_elf_cons, 4 },
   { "file",        dwarf2_directive_file, 0 },
@@ -2227,7 +2227,7 @@ symbol_locate (symbolP, name, segment, valu, frag)
 
   S_SET_SEGMENT (symbolP, segment);
   S_SET_VALUE (symbolP, valu);
-  symbol_clear_list_pointers(symbolP);
+  symbol_clear_list_pointers (symbolP);
 
   symbol_set_frag (symbolP, frag);
 
@@ -2585,16 +2585,19 @@ arm_s_data (ignore)
 #endif
 }
 
-#ifdef OBJ_ELF
 static void
 arm_s_section (ignore)
      int ignore;
 {
   s_ltorg (0);
 
+#ifdef OBJ_ELF
   obj_elf_section (ignore);
-}
 #endif
+#ifdef OBJ_COFF
+  obj_coff_section (ignore);
+#endif
+}
 
 static void
 opcode_select (width)
@@ -6960,7 +6963,7 @@ vfp_sp_reg_list (str, pos)
 
   /* Sanity check -- should have raised a parse error above.  */
   if (count == 0 || count > 32)
-    abort();
+    abort ();
 
   /* Final test -- the registers must be consecutive.  */
   while (count--)
@@ -7073,7 +7076,7 @@ vfp_dp_reg_list (str)
 
   /* Sanity check -- should have raised a parse error above.  */
   if (count == 0 || count > 16)
-    abort();
+    abort ();
 
   /* Final test -- the registers must be consecutive.  */
   while (count--)
@@ -7090,7 +7093,7 @@ vfp_dp_reg_list (str)
 }
 
 static void
-vfp_sp_ldstm(str, ldstm_type)
+vfp_sp_ldstm (str, ldstm_type)
      char *str;
      enum vfp_ldstm_type ldstm_type;
 {
@@ -7127,7 +7130,7 @@ vfp_sp_ldstm(str, ldstm_type)
 }
 
 static void
-vfp_dp_ldstm(str, ldstm_type)
+vfp_dp_ldstm (str, ldstm_type)
      char *str;
      enum vfp_ldstm_type ldstm_type;
 {
@@ -9936,6 +9939,7 @@ md_apply_fix3 (fixP, valP, seg)
        value = fixP->fx_offset;
 #endif
        value += diff;
+
        if ((value & ~0x3fffff) && ((value & ~0x3fffff) != ~0x3fffff))
          as_bad_where (fixP->fx_file, fixP->fx_line,
                        _("branch with link out of range"));
@@ -9943,14 +9947,11 @@ md_apply_fix3 (fixP, valP, seg)
        newval  = (newval  & 0xf800) | ((value & 0x7fffff) >> 12);
        newval2 = (newval2 & 0xf800) | ((value & 0xfff) >> 1);
        if (fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX)
-         /* Remove bit zero of the adjusted offset.  Bit zero can only be
-            set if the upper insn is at a half-word boundary, since the
-            destination address, an ARM instruction, must always be on a
-            word boundary.  The semantics of the BLX (1) instruction, however,
-            are that bit zero in the offset must always be zero, and the
-            corresponding bit one in the target address will be set from bit
-            one of the source address.  */
-         newval2 &= ~1;
+         /* For a BLX instruction, make sure that the relocation is rounded up
+            to a word boundary.  This follows the semantics of the instruction
+            which specifies that bit 1 of the target address will come from bit
+            1 of the base address.  */
+         newval2 = (newval2 + 1) & ~ 1;
        md_number_to_chars (buf, newval, THUMB_SIZE);
        md_number_to_chars (buf + THUMB_SIZE, newval2, THUMB_SIZE);
       }
@@ -10399,7 +10400,6 @@ md_assemble (str)
 #if 0
   arm_align (2, 0);
 #endif
-  listing_prev_line (); /* Defined in listing.h.  */
 
   /* Align the previous label if needed.  */
   if (last_label_seen != NULL)
@@ -11216,7 +11216,6 @@ arm_cleanup ()
   /* Put it at the end of text section.  */
   subseg_set (text_section, 0);
   s_ltorg (0);
-  listing_prev_line ();
 }
 
 void
This page took 0.026022 seconds and 4 git commands to generate.