2003-08-01 Jason Eckhardt <jle@rice.edu>
[deliverable/binutils-gdb.git] / gas / config / tc-frv.c
index 2a7db7075f28c82049fae6431856eeae3a0dcb2a..2b8d3ea88d4f569a08af6f81c9a4f3faaf6816b1 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-frv.c -- Assembler for the Fujitsu FRV.
-   Copyright (C) 2002 Free Software Foundation.
+   Copyright 2002, 2003 Free Software Foundation.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -20,7 +20,6 @@
 
 #include <stdio.h>
 #include "as.h"
-#include "dwarf2dbg.h"
 #include "subsegs.h"     
 #include "symcat.h"
 #include "opcodes/frv-desc.h"
@@ -67,8 +66,8 @@ enum vliw_insn_type
 #define NOP_KEEP 1             /* Keep these NOPS.  */
 #define NOP_DELETE 2           /* Delete these NOPS.  */
 
-#define DO_COUNT    true
-#define DONT_COUNT  false
+#define DO_COUNT    TRUE
+#define DONT_COUNT  FALSE
 
 /* A list of insns within a VLIW insn.  */
 struct vliw_insn_list
@@ -185,8 +184,6 @@ const pseudo_typeS md_pseudo_table[] =
   { "eflags",  frv_set_flags,          0 },
   { "word",    cons,                   4 },
   { "picptr",  frv_pic_ptr,            4 },
-  { "file",    (void (*) PARAMS ((int))) dwarf2_directive_file, 0 },
-  { "loc",     dwarf2_directive_loc,   0 },
   { NULL,      NULL,                   0 }
 };
 
@@ -467,9 +464,11 @@ md_begin ()
 
 int chain_num = 0;
 
+struct vliw_insn_list *frv_insert_vliw_insn PARAMS ((bfd_boolean));
+
 struct vliw_insn_list *
 frv_insert_vliw_insn (count)
-      boolean count;
+      bfd_boolean count;
 {
   struct vliw_insn_list *vliw_insn_list_entry;
   struct vliw_chain     *vliw_chain_entry;
@@ -538,6 +537,9 @@ frv_insert_vliw_insn (count)
 
 /* Check a vliw insn for an insn of type containing the sym passed in label_sym.  */
 
+static struct vliw_insn_list *frv_find_in_vliw
+  PARAMS ((enum vliw_insn_type, struct vliw_chain *, symbolS *));
+
 static struct vliw_insn_list *
 frv_find_in_vliw (vliw_insn_type, this_chain, label_sym)
     enum vliw_insn_type vliw_insn_type;
@@ -573,6 +575,8 @@ enum vliw_nop_type
   VLIW_DOUBLE_THEN_SINGLE_NOP
 };
 
+static void frv_debug_tomcat PARAMS ((struct vliw_chain *));
+
 static void
 frv_debug_tomcat (start_chain)
    struct vliw_chain *start_chain;
@@ -601,6 +605,7 @@ frv_debug_tomcat (start_chain)
    }
 }
 
+static void frv_adjust_vliw_count PARAMS ((struct vliw_chain *));
 
 static void
 frv_adjust_vliw_count (this_chain)
@@ -623,6 +628,8 @@ frv_adjust_vliw_count (this_chain)
 /* Insert the desired nop combination in the vliw chain before insert_before_insn.
    Rechain the vliw insn.  */
 
+static struct vliw_chain *frv_tomcat_shuffle
+  PARAMS ((enum vliw_nop_type, struct vliw_chain *, struct vliw_insn_list *));
 
 static struct vliw_chain *
 frv_tomcat_shuffle (this_nop_type, vliw_to_split, insert_before_insn)
@@ -631,7 +638,7 @@ frv_tomcat_shuffle (this_nop_type, vliw_to_split, insert_before_insn)
    struct vliw_insn_list *insert_before_insn;
 {
 
-  boolean pack_prev = false;
+  bfd_boolean pack_prev = FALSE;
   struct vliw_chain *return_me = NULL;
   struct vliw_insn_list *prev_insn = NULL;
   struct vliw_insn_list *curr_insn = vliw_to_split->insn_list;
@@ -652,7 +659,7 @@ frv_tomcat_shuffle (this_nop_type, vliw_to_split, insert_before_insn)
        Then don't set pack bit later.  */
 
       if (curr_insn->type != VLIW_LABEL_TYPE)
-       pack_prev = true;
+       pack_prev = TRUE;
       prev_insn = curr_insn;
       curr_insn = curr_insn->next;
     } 
@@ -792,6 +799,8 @@ frv_tomcat_shuffle (this_nop_type, vliw_to_split, insert_before_insn)
   return return_me;
 }
 
+static void frv_tomcat_analyze_vliw_chains PARAMS ((void));
+
 static void
 frv_tomcat_analyze_vliw_chains ()
 {
@@ -861,7 +870,7 @@ workaround_top:
        {
          if (this_insn->type == VLIW_LABEL_TYPE)
            {
-             if ((temp_insn = frv_find_in_vliw (VLIW_BRANCH_TYPE, vliw2, this_insn->sym, temp_insn)) != NULL)
+             if ((temp_insn = frv_find_in_vliw (VLIW_BRANCH_TYPE, vliw2, this_insn->sym)) != NULL)
                {
                  temp_insn->snop_frag->fr_subtype = NOP_KEEP;
                  vliw1 = frv_tomcat_shuffle (VLIW_SINGLE_NOP, vliw2, this_insn);
@@ -892,7 +901,7 @@ workaround_top:
 
       if (frv_is_branch_insn (this_insn->insn))
        {
-         if ((temp_insn = frv_find_in_vliw (VLIW_LABEL_TYPE, vliw1, this_insn->sym, temp_insn)) != NULL)
+         if ((temp_insn = frv_find_in_vliw (VLIW_LABEL_TYPE, vliw1, this_insn->sym)) != NULL)
            {
              /* Insert [nop/nop] [nop] before branch.  */
              this_insn->snop_frag->fr_subtype = NOP_KEEP;
@@ -1182,11 +1191,11 @@ md_cgen_lookup_reloc (insn, operand, fixP)
   switch (operand->type)
     {
     case FRV_OPERAND_LABEL16:
-      fixP->fx_pcrel = true;
+      fixP->fx_pcrel = TRUE;
       return BFD_RELOC_FRV_LABEL16;
 
     case FRV_OPERAND_LABEL24:
-      fixP->fx_pcrel = true;
+      fixP->fx_pcrel = TRUE;
       return BFD_RELOC_FRV_LABEL24;
 
     case FRV_OPERAND_UHI16:
@@ -1220,13 +1229,11 @@ int
 frv_force_relocation (fix)
      fixS * fix;
 {
-  if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY
-      || fix->fx_r_type == BFD_RELOC_FRV_GPREL12
+  if (fix->fx_r_type == BFD_RELOC_FRV_GPREL12
       || fix->fx_r_type == BFD_RELOC_FRV_GPRELU12)
     return 1;
 
-  return 0;
+  return generic_force_reloc (fix);
 }
 \f
 /* Write a value out to the object file, using the appropriate endianness.  */
@@ -1258,7 +1265,6 @@ md_atof (type, litP, sizeP)
   int              prec;
   LITTLENUM_TYPE   words [MAX_LITTLENUMS];
   char *           t;
-  char *           atof_ieee ();
 
   switch (type)
     {
@@ -1298,7 +1304,7 @@ md_atof (type, litP, sizeP)
   return 0;
 }
 
-boolean
+bfd_boolean
 frv_fix_adjustable (fixP)
    fixS * fixP;
 {
@@ -1314,16 +1320,6 @@ frv_fix_adjustable (fixP)
   else
     reloc_type = fixP->fx_r_type;
 
-  if (fixP->fx_addsy == NULL)
-    return 1;
-  
-  /* Prevent all adjustments to global symbols. */
-  if (S_IS_EXTERN (fixP->fx_addsy))
-    return 0;
-  
-  if (S_IS_WEAK (fixP->fx_addsy))
-    return 0;
-  
   /* We need the symbol name for the VTABLE entries */
   if (   reloc_type == BFD_RELOC_VTABLE_INHERIT
       || reloc_type == BFD_RELOC_VTABLE_ENTRY
This page took 0.025985 seconds and 4 git commands to generate.