* config/tc-sh.c (md_convert_frag) <undefined symbol, conditional
authorHans-Peter Nilsson <hp@axis.com>
Tue, 28 Nov 2000 23:33:45 +0000 (23:33 +0000)
committerHans-Peter Nilsson <hp@axis.com>
Tue, 28 Nov 2000 23:33:45 +0000 (23:33 +0000)
jump>: Use as_bad_where instead of as_bad.  Tweak error message
accordingly.  Stabilize frag by updating fix part and resetting
variant part.
<undefined symbol, unconditional jump>: Ditto.

gas/ChangeLog
gas/config/tc-sh.c

index c8c9051ded807c30331818cb818567ba5918aa02..3ad341a3d11d884fef7e4aaca9d0274bdfb5bb75 100644 (file)
@@ -1,3 +1,11 @@
+2000-11-28  Hans-Peter Nilsson  <hp@bitrange.com>
+
+       * config/tc-sh.c (md_convert_frag) <undefined symbol, conditional
+       jump>: Use as_bad_where instead of as_bad.  Tweak error message
+       accordingly.  Stabilize frag by updating fix part and resetting
+       variant part.
+       <undefined symbol, unconditional jump>: Ditto.
+
 2000-11-28  Kazu Hirata  <kazu@hxi.com>
 
        * config/obj-aout.h: Fix formatting.
index cdf249e3f24026ff719af694ed610bc1714c6f4d..306d200d0a0b85d6eb35a7a2015e3add6b2844e5 100644 (file)
@@ -2391,17 +2391,19 @@ md_convert_frag (headers, seg, fragP)
     case C (UNCOND_JUMP, UNCOND32):
     case C (UNCOND_JUMP, UNDEF_WORD_DISP):
       if (fragP->fr_symbol == NULL)
-       as_bad (_("at 0x%lx, displacement overflows 12-bit field"),
-               (unsigned long) fragP->fr_address);
+       as_bad_where (fragP->fr_file, fragP->fr_line,
+                     _("displacement overflows 12-bit field"));
       else if (S_IS_DEFINED (fragP->fr_symbol))
-       as_bad (_("at 0x%lx, displacement to defined symbol %s overflows 12-bit field"),
-               (unsigned long) fragP->fr_address,
-               S_GET_NAME (fragP->fr_symbol));
+       as_bad_where (fragP->fr_file, fragP->fr_line,
+                     _("displacement to defined symbol %s overflows 12-bit field"),
+                     S_GET_NAME (fragP->fr_symbol));
       else
-       as_bad (_("at 0x%lx, displacement to undefined symbol %s overflows 12-bit field"),
-               (unsigned long) fragP->fr_address,
-               S_GET_NAME (fragP->fr_symbol));
-
+       as_bad_where (fragP->fr_file, fragP->fr_line,
+                     _("displacement to undefined symbol %s overflows 12-bit field"),
+                     S_GET_NAME (fragP->fr_symbol));
+      /* Stabilize this frag, so we don't trip an assert.  */
+      fragP->fr_fix += fragP->fr_var;
+      fragP->fr_var = 0;
       break;
 
     case C (COND_JUMP, COND12):
@@ -2474,16 +2476,19 @@ md_convert_frag (headers, seg, fragP)
     case C (COND_JUMP, UNDEF_WORD_DISP):
     case C (COND_JUMP_DELAY, UNDEF_WORD_DISP):
       if (fragP->fr_symbol == NULL)
-       as_bad (_("at 0x%lx, displacement overflows 8-bit field"),
-               (unsigned long) fragP->fr_address);
+       as_bad_where (fragP->fr_file, fragP->fr_line,
+                     _("displacement overflows 8-bit field"));
       else if (S_IS_DEFINED (fragP->fr_symbol))
-       as_bad (_("at 0x%lx, displacement to defined symbol %s overflows 8-bit field "),
-               (unsigned long) fragP->fr_address,
-               S_GET_NAME (fragP->fr_symbol));
+       as_bad_where (fragP->fr_file, fragP->fr_line,
+                     _("displacement to defined symbol %s overflows 8-bit field"),
+                     S_GET_NAME (fragP->fr_symbol));
       else
-       as_bad (_("at 0x%lx, displacement to undefined symbol %s overflows 8-bit field "),
-               (unsigned long) fragP->fr_address,
-               S_GET_NAME (fragP->fr_symbol));
+       as_bad_where (fragP->fr_file, fragP->fr_line,
+                     _("displacement to undefined symbol %s overflows 8-bit field "),
+                     S_GET_NAME (fragP->fr_symbol));
+      /* Stabilize this frag, so we don't trip an assert.  */
+      fragP->fr_fix += fragP->fr_var;
+      fragP->fr_var = 0;
       break;
 
     default: