/
authorAlan Modra <amodra@gmail.com>
Mon, 17 May 1999 03:21:46 +0000 (03:21 +0000)
committerAlan Modra <amodra@gmail.com>
Mon, 17 May 1999 03:21:46 +0000 (03:21 +0000)
Move bitfield overflow checks to after the md_apply_fix call in
fixup_segment so that md_apply_fix has a chance to modify value.
Handle 8 and 16-bit pcrel relocs for i386.
Prototypes and other minor code cleanups.

gas/expr.c
gas/hash.h
gas/read.c
gas/write.c

index d5d55fd..b49720c 100644 (file)
 #include "obstack.h"
 
 static void floating_constant PARAMS ((expressionS * expressionP));
+static valueT generic_bignum_to_int32 PARAMS ((void));
+#ifdef BFD64
+static valueT generic_bignum_to_int64 PARAMS ((void));
+#endif
 static void integer_constant PARAMS ((int radix, expressionS * expressionP));
 static void mri_char_constant PARAMS ((expressionS *));
 static void current_location PARAMS ((expressionS *));
index fb229c8..98eb347 100644 (file)
@@ -42,4 +42,4 @@ void hash_print_statistics PARAMS ((FILE *, const char *,
                                    struct hash_control *));
 #endif /* #ifdef hashH */
 
-/* end of hash.c */
+/* end of hash.h */
index 7fee241..abee749 100644 (file)
@@ -211,7 +211,15 @@ static void cons_worker PARAMS ((int, int));
 static int scrub_from_string PARAMS ((char **));
 static void do_align PARAMS ((int, char *, int, int));
 static void s_align PARAMS ((int, int));
+static void s_lcomm_internal PARAMS ((int, int));
 static int hex_float PARAMS ((int, char *));
+static inline int sizeof_sleb128 PARAMS ((offsetT));
+static inline int sizeof_uleb128 PARAMS ((valueT));
+static inline int output_sleb128 PARAMS ((char *, offsetT));
+static inline int output_uleb128 PARAMS ((char *, valueT));
+static inline int output_big_sleb128 PARAMS ((char *, LITTLENUM_TYPE *, int));
+static inline int output_big_uleb128 PARAMS ((char *, LITTLENUM_TYPE *, int));
+static int output_big_leb128 PARAMS ((char *, LITTLENUM_TYPE *, int, int));
 static void do_org PARAMS ((segT, expressionS *, int));
 char *demand_copy_string PARAMS ((int *lenP));
 static segT get_segmented_expression PARAMS ((expressionS *expP));
@@ -4207,7 +4215,7 @@ output_leb128 (p, value, sign)
    we don't output for NULL values of P.  It isn't really as critical as
    for "normal" values that this be streamlined.  */
 
-static int
+static inline int
 output_big_sleb128 (p, bignum, size)
      char *p;
      LITTLENUM_TYPE *bignum;
@@ -4253,7 +4261,7 @@ output_big_sleb128 (p, bignum, size)
   return p - orig;
 }
 
-static int
+static inline int
 output_big_uleb128 (p, bignum, size)
      char *p;
      LITTLENUM_TYPE *bignum;
@@ -4295,7 +4303,7 @@ output_big_uleb128 (p, bignum, size)
   return p - orig;
 }
 
-static inline int
+static int
 output_big_leb128 (p, bignum, size, sign)
      char *p;
      LITTLENUM_TYPE *bignum;
index 18e6e10..13f78b9 100644 (file)
@@ -2707,6 +2707,27 @@ fixup_segment (fixP, this_segment_type)
            }
        }
 
+      if (!fixP->fx_done)
+       {
+#ifdef MD_APPLY_FIX3
+         md_apply_fix3 (fixP, &add_number, this_segment_type);
+#else
+#ifdef BFD_ASSEMBLER
+         md_apply_fix (fixP, &add_number);
+#else
+         md_apply_fix (fixP, add_number);
+#endif
+#endif
+
+#ifndef TC_HANDLES_FX_DONE
+         /* If the tc-* files haven't been converted, assume it's handling
+            it the old way, where a null fx_addsy means that the fix has
+            been applied completely, and no further work is needed.  */
+         if (fixP->fx_addsy == 0 && fixP->fx_pcrel == 0)
+           fixP->fx_done = 1;
+#endif
+       }
+
       if (!fixP->fx_bit_fixP && !fixP->fx_no_overflow && size > 0)
        {
          if ((size_t) size < sizeof (valueT))
@@ -2755,26 +2776,6 @@ fixup_segment (fixP, this_segment_type)
 #endif
        }                       /* not a bit fix */
 
-      if (!fixP->fx_done)
-       {
-#ifdef MD_APPLY_FIX3
-         md_apply_fix3 (fixP, &add_number, this_segment_type);
-#else
-#ifdef BFD_ASSEMBLER
-         md_apply_fix (fixP, &add_number);
-#else
-         md_apply_fix (fixP, add_number);
-#endif
-#endif
-
-#ifndef TC_HANDLES_FX_DONE
-         /* If the tc-* files haven't been converted, assume it's handling
-            it the old way, where a null fx_addsy means that the fix has
-            been applied completely, and no further work is needed.  */
-         if (fixP->fx_addsy == 0 && fixP->fx_pcrel == 0)
-           fixP->fx_done = 1;
-#endif
-       }
 #ifdef TC_VALIDATE_FIX
     skip: ;
 #endif
@@ -2824,7 +2825,7 @@ void
 write_print_statistics (file)
      FILE *file;
 {
-  fprintf (stderr, "fixups: %d\n", n_fixups);
+  fprintf (file, "fixups: %d\n", n_fixups);
 }
 
 /* for debugging */