Update all uses of md_apply_fix to use md_apply_fix3. Make it a void function.
[deliverable/binutils-gdb.git] / gas / config / tc-v850.c
index 5e104f841f75ea2f8bbe734c426aa27d147175ae..8f12245ead823bf6f989cb30a34d88c2de9417b7 100644 (file)
@@ -2210,7 +2210,7 @@ md_assemble (str)
      BFD_RELOC_UNUSED plus the operand index.  This lets us easily
      handle fixups for any operand type, although that is admittedly
      not a very exciting feature.  We pick a BFD reloc type in
-     md_apply_fix.  */
+     md_apply_fix3.  */
   for (i = 0; i < fc; i++)
     {
       const struct v850_operand *operand;
@@ -2340,52 +2340,51 @@ v850_pcrel_from_section (fixp, section)
   return fixp->fx_frag->fr_address + fixp->fx_where;
 }
 
-int
-md_apply_fix3 (fixp, valuep, seg)
-     fixS *fixp;
-     valueT *valuep;
+void
+md_apply_fix3 (fixP, valueP, seg)
+     fixS *fixP;
+     valueT *valueP;
      segT seg ATTRIBUTE_UNUSED;
 {
-  valueT value;
+  valueT value = * valueP;
   char *where;
 
-  if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT
-      || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
+  if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT
+      || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY)
     {
-      fixp->fx_done = 0;
-      return 1;
+      fixP->fx_done = 0;
+      return;
     }
 
-  if (fixp->fx_addsy == (symbolS *) NULL)
-    {
-      value = *valuep;
-      fixp->fx_done = 1;
-    }
-  else if (fixp->fx_pcrel)
-    value = *valuep;
+  if (fixP->fx_addsy == (symbolS *) NULL)
+    fixP->fx_done = 1;
+
+  else if (fixP->fx_pcrel)
+    ;
+
   else
     {
-      value = fixp->fx_offset;
-      if (fixp->fx_subsy != (symbolS *) NULL)
+      value = fixP->fx_offset;
+      if (fixP->fx_subsy != (symbolS *) NULL)
        {
-         if (S_GET_SEGMENT (fixp->fx_subsy) == absolute_section)
-           value -= S_GET_VALUE (fixp->fx_subsy);
+         if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section)
+           value -= S_GET_VALUE (fixP->fx_subsy);
          else
            {
              /* We don't actually support subtracting a symbol.  */
-             as_bad_where (fixp->fx_file, fixp->fx_line,
+             as_bad_where (fixP->fx_file, fixP->fx_line,
                            _("expression too complex"));
            }
        }
     }
 
-  if ((int) fixp->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
     {
       int opindex;
       const struct v850_operand *operand;
       unsigned long insn;
 
-      opindex = (int) fixp->fx_r_type - (int) BFD_RELOC_UNUSED;
+      opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
       operand = &v850_operands[opindex];
 
       /* Fetch the instruction, insert the fully resolved operand
@@ -2393,53 +2392,50 @@ md_apply_fix3 (fixp, valuep, seg)
 
         Note the instruction has been stored in little endian
         format!  */
-      where = fixp->fx_frag->fr_literal + fixp->fx_where;
+      where = fixP->fx_frag->fr_literal + fixP->fx_where;
 
       insn = bfd_getl32 ((unsigned char *) where);
       insn = v850_insert_operand (insn, operand, (offsetT) value,
-                                 fixp->fx_file, fixp->fx_line, NULL);
+                                 fixP->fx_file, fixP->fx_line, NULL);
       bfd_putl32 ((bfd_vma) insn, (unsigned char *) where);
 
-      if (fixp->fx_done)
-       {
-         /* Nothing else to do here.  */
-         return 1;
-       }
+      if (fixP->fx_done)
+       /* Nothing else to do here.  */
+       return;
 
       /* Determine a BFD reloc value based on the operand information.
         We are only prepared to turn a few of the operands into relocs.  */
 
       if (operand->bits == 22)
-       fixp->fx_r_type = BFD_RELOC_V850_22_PCREL;
+       fixP->fx_r_type = BFD_RELOC_V850_22_PCREL;
       else if (operand->bits == 9)
-       fixp->fx_r_type = BFD_RELOC_V850_9_PCREL;
+       fixP->fx_r_type = BFD_RELOC_V850_9_PCREL;
       else
        {
 #if 0
          fprintf (stderr, "bits: %d, insn: %x\n", operand->bits, insn);
 #endif
 
-         as_bad_where (fixp->fx_file, fixp->fx_line,
+         as_bad_where (fixP->fx_file, fixP->fx_line,
                        _("unresolved expression that must be resolved"));
-         fixp->fx_done = 1;
-         return 1;
+         fixP->fx_done = 1;
+         return;
        }
     }
-  else if (fixp->fx_done)
+  else if (fixP->fx_done)
     {
       /* We still have to insert the value into memory!  */
-      where = fixp->fx_frag->fr_literal + fixp->fx_where;
+      where = fixP->fx_frag->fr_literal + fixP->fx_where;
 
-      if (fixp->fx_size == 1)
+      if (fixP->fx_size == 1)
        *where = value & 0xff;
-      else if (fixp->fx_size == 2)
+      else if (fixP->fx_size == 2)
        bfd_putl16 (value & 0xffff, (unsigned char *) where);
-      else if (fixp->fx_size == 4)
+      else if (fixP->fx_size == 4)
        bfd_putl32 (value, (unsigned char *) where);
     }
 
-  fixp->fx_addnumber = value;
-  return 1;
+  fixP->fx_addnumber = value;
 }
 \f
 /* Parse a cons expression.  We have to handle hi(), lo(), etc
This page took 0.030968 seconds and 4 git commands to generate.