]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gas/config/tc-v850.c
Fix more fallout from multi-pass relaxation patch.
[thirdparty/binutils-gdb.git] / gas / config / tc-v850.c
index 1f157d7c30304a5cfdbeb74740723929a339bf96..89f4b987899209b995dd4553a80074789731361e 100644 (file)
@@ -604,8 +604,8 @@ const pseudo_typeS md_pseudo_table[] = {
   {"call_table_text", v850_call_table_text, 0},
   {"v850e",           set_machine,          bfd_mach_v850e},
   {"v850ea",          set_machine,          bfd_mach_v850ea},
-  {"file",    dwarf2_directive_file },
-  {"loc",     dwarf2_directive_loc },
+  {"file",    dwarf2_directive_file, 0},
+  {"loc",     dwarf2_directive_loc, 0},
   { NULL,     NULL,         0}
 };
 
@@ -1321,7 +1321,6 @@ md_convert_frag (abfd, sec, fragP)
     {
       fix_new (fragP, fragP->fr_fix, 2, fragP->fr_symbol,
               fragP->fr_offset, 1, BFD_RELOC_UNUSED + (int)fragP->fr_opcode);
-      fragP->fr_var = 0;
       fragP->fr_fix += 2;
     }
   /* Out of range conditional branch.  Emit a branch around a jump.  */
@@ -1345,7 +1344,6 @@ md_convert_frag (abfd, sec, fragP)
       fix_new (fragP, fragP->fr_fix + 2, 4, fragP->fr_symbol,
               fragP->fr_offset, 1, BFD_RELOC_UNUSED +
               (int) fragP->fr_opcode + 1);
-      fragP->fr_var = 0;
       fragP->fr_fix += 6;
     }
   /* Out of range unconditional branch.  Emit a jump.  */
@@ -1355,7 +1353,6 @@ md_convert_frag (abfd, sec, fragP)
       fix_new (fragP, fragP->fr_fix, 4, fragP->fr_symbol,
               fragP->fr_offset, 1, BFD_RELOC_UNUSED +
               (int) fragP->fr_opcode + 1);
-      fragP->fr_var = 0;
       fragP->fr_fix += 4;
     }
   else
@@ -2315,20 +2312,17 @@ tc_gen_reloc (seg, fixp)
   return reloc;
 }
 
-/* Assume everything will fit in two bytes, then expand as necessary.  */
+/* Return current size of variable part of frag.  */
 
 int
 md_estimate_size_before_relax (fragp, seg)
      fragS *fragp;
      asection *seg ATTRIBUTE_UNUSED;
 {
-  if (fragp->fr_subtype == 0)
-    fragp->fr_var = 4;
-  else if (fragp->fr_subtype == 2)
-    fragp->fr_var = 2;
-  else
+  if (fragp->fr_subtype >= sizeof (md_relax_table) / sizeof (md_relax_table[0]))
     abort ();
-  return 2;
+
+  return md_relax_table[fragp->fr_subtype].rlx_length;
 }
 
 long