]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas bfd_reloc_code_real_type
authorAlan Modra <amodra@gmail.com>
Tue, 8 Jul 2025 23:28:11 +0000 (08:58 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 9 Jul 2025 00:05:06 +0000 (09:35 +0930)
Enumeration constants are integer types, so there should be no need to
cast such constants to int in expressions.  (Perhaps some older gccs
warned, I checked back to gcc-4.5.)  Remove some of those unnecessary
casts.  Also remove unnecessary casts to bfd_reloc_code_real_type.

17 files changed:
gas/cgen.c
gas/config/tc-alpha.c
gas/config/tc-arc.c
gas/config/tc-arm.c
gas/config/tc-epiphany.c
gas/config/tc-frv.c
gas/config/tc-iq2000.c
gas/config/tc-m32c.c
gas/config/tc-m32r.c
gas/config/tc-mep.c
gas/config/tc-mips.c
gas/config/tc-mn10300.c
gas/config/tc-mt.c
gas/config/tc-ppc.c
gas/config/tc-s390.c
gas/config/tc-v850.c
gas/config/tc-xstormy16.c

index 030c2f0bebde30965163c74862de63a4ba8d1135..8fbb531035c03e0de27b56ac274cd74b48ab1960 100644 (file)
@@ -248,9 +248,7 @@ gas_cgen_record_fixup (fragS *frag, int where, const CGEN_INSN *insn,
      but it is the operand that has a pc relative relocation.  */
   fixP = fix_new (frag, where, length / 8, symbol, offset,
                  CGEN_OPERAND_ATTR_VALUE (operand, CGEN_OPERAND_PCREL_ADDR),
-                 (bfd_reloc_code_real_type)
-                   ((int) BFD_RELOC_UNUSED
-                    + (int) operand->type));
+                 BFD_RELOC_UNUSED + operand->type);
   fixP->fx_cgen.insn = insn;
   fixP->fx_cgen.opinfo = opinfo;
   fixP->fx_cgen.field = NULL;
@@ -283,9 +281,7 @@ gas_cgen_record_fixup_exp (fragS *frag, int where, const CGEN_INSN *insn,
      but it is the operand that has a pc relative relocation.  */
   fixP = fix_new_exp (frag, where, length / 8, exp,
                      CGEN_OPERAND_ATTR_VALUE (operand, CGEN_OPERAND_PCREL_ADDR),
-                     (bfd_reloc_code_real_type)
-                       ((int) BFD_RELOC_UNUSED
-                        + (int) operand->type));
+                     BFD_RELOC_UNUSED + operand->type);
   fixP->fx_cgen.insn = insn;
   fixP->fx_cgen.opinfo = opinfo;
   fixP->fx_cgen.field = NULL;
@@ -859,9 +855,9 @@ gas_cgen_md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
   if (fixP->fx_subsy != (symbolS *) NULL)
     as_bad_where (fixP->fx_file, fixP->fx_line, _("expression too complex"));
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand = cgen_operand_lookup_by_num (cd, opindex);
       const char *errmsg;
       bfd_reloc_code_real_type reloc_type;
index e66e8d6a85c39b50cb4ac9e13f649fa1f2fb02b5..2d66986560f0d1b2795774742b0d6c1a8edead55 100644 (file)
@@ -1777,8 +1777,7 @@ emit_insn (struct alpha_insn *insn)
       else
        {
          reloc_howto_type *reloc_howto =
-              bfd_reloc_type_lookup (stdoutput,
-                                     (bfd_reloc_code_real_type) fixup->reloc);
+           bfd_reloc_type_lookup (stdoutput, fixup->reloc);
          gas_assert (reloc_howto);
 
          size = bfd_get_reloc_size (reloc_howto);
@@ -1800,7 +1799,7 @@ emit_insn (struct alpha_insn *insn)
        }
 
       fixP = fix_new_exp (frag_now, f - frag_now->fr_literal, size,
-                         &fixup->exp, pcrel, (bfd_reloc_code_real_type) fixup->reloc);
+                         &fixup->exp, pcrel, fixup->reloc);
 
       /* Turn off complaints that the addend is too large for some fixups,
          and copy in the sequence number for the explicit relocations.  */
@@ -2138,8 +2137,7 @@ assemble_insn (const struct alpha_opcode *opcode,
       else if (reloc < BFD_RELOC_UNUSED && reloc > 0)
        {
          reloc_howto_type *reloc_howto
-              = bfd_reloc_type_lookup (stdoutput,
-                                       (bfd_reloc_code_real_type) reloc);
+           = bfd_reloc_type_lookup (stdoutput, reloc);
          if (reloc_operand == NULL
              || reloc_howto->bitsize != reloc_operand->bits)
            {
index 30d6cb9c50dd92cfb5dff3218cc883508b29a18a..ff14e91f8a461a0c83e5f32aee0ba3247d695fb4 100644 (file)
@@ -1457,8 +1457,7 @@ apply_fixups (struct arc_insn *insn, fragS *fragP, int fix)
       else
        {
          reloc_howto_type *reloc_howto =
-           bfd_reloc_type_lookup (stdoutput,
-                                  (bfd_reloc_code_real_type) fixup->reloc);
+           bfd_reloc_type_lookup (stdoutput, fixup->reloc);
          gas_assert (reloc_howto);
 
          /* FIXME! the reloc size is wrong in the BFD file.
@@ -4058,8 +4057,7 @@ assemble_insn (const struct arc_opcode *opcode,
            {
              /* sanity checks.  */
              reloc_howto_type *reloc_howto
-               = bfd_reloc_type_lookup (stdoutput,
-                                        (bfd_reloc_code_real_type) reloc);
+               = bfd_reloc_type_lookup (stdoutput, reloc);
              unsigned reloc_bitsize = reloc_howto->bitsize;
              if (reloc_howto->rightshift)
                reloc_bitsize -= reloc_howto->rightshift;
@@ -4083,8 +4081,7 @@ assemble_insn (const struct arc_opcode *opcode,
          else
            {
              reloc_howto_type *reloc_howto =
-               bfd_reloc_type_lookup (stdoutput,
-                                      (bfd_reloc_code_real_type) fixup->reloc);
+               bfd_reloc_type_lookup (stdoutput, fixup->reloc);
              pcrel = reloc_howto->pc_relative;
            }
          fixup->pcrel = pcrel;
index 13afe8d3e4817e6bb2ae04a5430cc7a154cf0202..c6045a1ff805304e269f0f2b94a242a72ed70266 100644 (file)
@@ -3844,9 +3844,8 @@ s_arm_elf_cons (int nbytes)
            emit_expr (&exp, (unsigned int) nbytes);
          else
            {
-             reloc_howto_type *howto = (reloc_howto_type *)
-                 bfd_reloc_type_lookup (stdoutput,
-                                        (bfd_reloc_code_real_type) reloc);
+             reloc_howto_type *howto = bfd_reloc_type_lookup (stdoutput,
+                                                              reloc);
              int size = bfd_get_reloc_size (howto);
 
              if (reloc == BFD_RELOC_ARM_PLT32)
@@ -22218,8 +22217,8 @@ fix_new_arm (fragS *       frag,
       break;
 
     default:
-      new_fix = (fixS *) fix_new (frag, where, size, make_expr_symbol (exp), 0,
-                                 pc_rel, (enum bfd_reloc_code_real) reloc);
+      new_fix = fix_new (frag, where, size, make_expr_symbol (exp), 0,
+                        pc_rel, reloc);
       break;
     }
 
index 4a027e9f31d2d8c0959ce5146222b7194d617c45..64d70f4cb5d4e6c9aa36b7a52ca5e728720b8140 100644 (file)
@@ -251,7 +251,7 @@ epiphany_apply_fix (fixS *fixP, valueT *valP, segT seg)
   if (fixP->fx_addsy == (symbolS *) NULL)
     fixP->fx_done = 1;
 
-  if (((int) fixP->fx_r_type < (int) BFD_RELOC_UNUSED)
+  if ((fixP->fx_r_type < BFD_RELOC_UNUSED)
       && fixP->fx_done)
     {
       /* Install EPIPHANY-dependent relocations HERE because nobody else
@@ -1025,10 +1025,10 @@ epiphany_fix_adjustable (fixS *fixP)
 {
  bfd_reloc_code_real_type reloc_type;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = fixP->fx_cgen.insn;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand =
        cgen_operand_lookup_by_num (gas_cgen_cpu_desc, opindex);
 
index 2c33c90f7833edc26527167e45e254258523546b..2c84812b5c7714bb0966929899daf5a78f2c4e8d 100644 (file)
@@ -1523,10 +1523,10 @@ frv_fix_adjustable (fixS *fixP)
 {
   bfd_reloc_code_real_type reloc_type;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = NULL;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
       reloc_type = md_cgen_lookup_reloc (insn, operand, fixP);
     }
@@ -1705,7 +1705,7 @@ frv_frob_file_section (bfd *abfd, asection *sec, void *ptr ATTRIBUTE_UNUSED)
        }
       else
        {
-         opindex = (int) fixp->fx_r_type - (int) BFD_RELOC_UNUSED;
+         opindex = fixp->fx_r_type - BFD_RELOC_UNUSED;
          operand = cgen_operand_lookup_by_num (cd, opindex);
          reloc = md_cgen_lookup_reloc (insn, operand, fixp);
        }
index 1957235dfc8093328d4a1a57e539c3850f486e1d..e7e123574d1e7e60e60309f3a67dc70ce4f98c47 100644 (file)
@@ -728,10 +728,10 @@ iq2000_fix_adjustable (fixS * fixP)
 {
   bfd_reloc_code_real_type reloc_type;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = NULL;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
 
       reloc_type = md_cgen_lookup_reloc (insn, operand, fixP);
index 2eddf16034f757023e85b2d007f7d673041bec77..de2f86c87e25f4efdfd71b2c7a0b29495debea87 100644 (file)
@@ -1136,9 +1136,9 @@ m32c_fix_adjustable (fixS * fixP)
 
   /* We need the symbol name for the VTABLE entries.  */
   reloc = fixP->fx_r_type;
-  if (reloc > (int)BFD_RELOC_UNUSED)
+  if (reloc > BFD_RELOC_UNUSED)
     {
-      reloc -= (int)BFD_RELOC_UNUSED;
+      reloc -= BFD_RELOC_UNUSED;
       switch (reloc)
        {
        case M32C_OPERAND_DSP_32_S16:
index e9d9cc930ec30373234c50dba430c6da6669721a..6946b2e50c8d9d2cff57a2b18d61acc5bb23dd7b 100644 (file)
@@ -2128,10 +2128,10 @@ m32r_fix_adjustable (fixS *fixP)
 {
   bfd_reloc_code_real_type reloc_type;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = NULL;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand =
        cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
 
index 5e534210e5b8b0fcc79e812e9fccd253c837dfe3..d35a8639c495f9a1f2f87e72892034891e55871d 100644 (file)
@@ -2051,10 +2051,10 @@ mep_fix_adjustable (fixS *fixP)
 {
   bfd_reloc_code_real_type reloc_type;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = NULL;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand
        = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
       reloc_type = md_cgen_lookup_reloc (insn, operand, fixP);
index 5e602a47a4ec1b4df82583e80283bb5044070f0c..9f4e01dd64a83e455cfb628c5c9af911b728787b 100644 (file)
@@ -7728,17 +7728,16 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
       && delayed_branch_p (ip))
     {
       relaxed_branch = true;
-      add_relaxed_insn (ip, (relaxed_branch_length
-                            (NULL, NULL,
-                             uncond_branch_p (ip) ? -1
-                             : branch_likely_p (ip) ? 1
-                             : 0)), 4,
-                       RELAX_BRANCH_ENCODE
-                       (AT, mips_pic != NO_PIC,
-                        uncond_branch_p (ip),
-                        branch_likely_p (ip),
-                        pinfo & INSN_WRITE_GPR_31,
-                        0),
+      add_relaxed_insn (ip,
+                       relaxed_branch_length (NULL, NULL,
+                                              uncond_branch_p (ip) ? -1
+                                              : branch_likely_p (ip) ? 1
+                                              : 0),
+                       4,
+                       RELAX_BRANCH_ENCODE (AT, mips_pic != NO_PIC,
+                                            uncond_branch_p (ip),
+                                            branch_likely_p (ip),
+                                            pinfo & INSN_WRITE_GPR_31, 0),
                        address_expr->X_add_symbol,
                        address_expr->X_add_number);
       *reloc_type = BFD_RELOC_UNUSED;
@@ -7814,15 +7813,15 @@ append_insn (struct mips_cl_insn *ip, expressionS *address_expr,
          offset = 0;
        }
       add_relaxed_insn (ip, 12, 0,
-                       RELAX_MIPS16_ENCODE
-                       (*reloc_type - BFD_RELOC_UNUSED,
-                        mips_opts.ase & ASE_MIPS16E2,
-                        mips_pic != NO_PIC,
-                        HAVE_32BIT_SYMBOLS,
-                        mips_opts.warn_about_macros,
-                        require_unextended, require_extended,
-                        delayed_branch_p (&history[0]),
-                        history[0].mips16_absolute_jump_p),
+                       RELAX_MIPS16_ENCODE (*reloc_type - BFD_RELOC_UNUSED,
+                                            mips_opts.ase & ASE_MIPS16E2,
+                                            mips_pic != NO_PIC,
+                                            HAVE_32BIT_SYMBOLS,
+                                            mips_opts.warn_about_macros,
+                                            require_unextended,
+                                            require_extended,
+                                            delayed_branch_p (&history[0]),
+                                            history[0].mips16_absolute_jump_p),
                        symbol, offset);
     }
   else if (mips_opts.mips16 && insn_length (ip) == 2)
@@ -8438,7 +8437,7 @@ match_insn (struct mips_cl_insn *insn, const struct mips_opcode *opcode,
            case 'D':
            case 'E':
              if (!forced_insn_length)
-               *offset_reloc = (int) BFD_RELOC_UNUSED + c;
+               *offset_reloc = BFD_RELOC_UNUSED + c;
              else if (c == 'D')
                *offset_reloc = BFD_RELOC_MICROMIPS_10_PCREL_S1;
              else
@@ -8566,7 +8565,7 @@ match_mips16_insn (struct mips_cl_insn *insn, const struct mips_opcode *opcode,
                }
            }
          else if (relax_char)
-           *offset_reloc = (int) BFD_RELOC_UNUSED + relax_char;
+           *offset_reloc = BFD_RELOC_UNUSED + relax_char;
 
          check_completed_insn (&arg);
          return true;
@@ -8988,11 +8987,11 @@ macro_read_relocs (va_list *args, bfd_reloc_code_real_type *r)
 
   next = va_arg (*args, int);
   if (next >= 0)
-    r[0] = (bfd_reloc_code_real_type) next;
+    r[0] = next;
   else
     {
       for (i = 0; i < 3; i++)
-       r[i] = (bfd_reloc_code_real_type) va_arg (*args, int);
+       r[i] = va_arg (*args, int);
       /* This function is only used for 16-bit relocation fields.
         To make the macro code simpler, treat an unrelocated value
         in the same way as BFD_RELOC_LO16.  */
@@ -9240,7 +9239,7 @@ mips16_macro_build (expressionS *ep, const char *name, const char *fmt,
            gas_assert (ep != NULL);
 
            if (ep->X_op != O_constant)
-             *r = (int) BFD_RELOC_UNUSED + c;
+             *r = BFD_RELOC_UNUSED + c;
            else if (calculate_reloc (*r, ep->X_add_number, &value))
              {
                mips16_immed (NULL, 0, c, *r, value, 0, &insn.insn_opcode);
@@ -11120,7 +11119,7 @@ macro (struct mips_cl_insn *ip, char *str)
        }
       else if (!mips_big_got && !HAVE_NEWABI)
        {
-         int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
+         int lw_reloc_type = BFD_RELOC_MIPS_GOT16;
 
          /* If this is a reference to an external symbol, and there
             is no constant, we want
@@ -11157,7 +11156,7 @@ macro (struct mips_cl_insn *ip, char *str)
              if (mips_pic == SVR4_PIC
                  && breg == 0
                  && (call || tempreg == PIC_CALL_REG))
-               lw_reloc_type = (int) BFD_RELOC_MIPS_CALL16;
+               lw_reloc_type = BFD_RELOC_MIPS_CALL16;
 
              relax_start (offset_expr.X_add_symbol);
              macro_build (&offset_expr, ADDRESS_LOAD_INSN, "t,o(b)", tempreg,
@@ -11319,9 +11318,9 @@ macro (struct mips_cl_insn *ip, char *str)
       else if (mips_big_got && !HAVE_NEWABI)
        {
          int gpdelay;
-         int lui_reloc_type = (int) BFD_RELOC_MIPS_GOT_HI16;
-         int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT_LO16;
-         int local_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
+         int lui_reloc_type = BFD_RELOC_MIPS_GOT_HI16;
+         int lw_reloc_type = BFD_RELOC_MIPS_GOT_LO16;
+         int local_reloc_type = BFD_RELOC_MIPS_GOT16;
 
          /* This is the large GOT case.  If this is a reference to an
             external symbol, and there is no constant, we want
@@ -11371,8 +11370,8 @@ macro (struct mips_cl_insn *ip, char *str)
          if (expr1.X_add_number == 0 && breg == 0
              && (call || tempreg == PIC_CALL_REG))
            {
-             lui_reloc_type = (int) BFD_RELOC_MIPS_CALL_HI16;
-             lw_reloc_type = (int) BFD_RELOC_MIPS_CALL_LO16;
+             lui_reloc_type = BFD_RELOC_MIPS_CALL_HI16;
+             lw_reloc_type = BFD_RELOC_MIPS_CALL_LO16;
            }
          macro_build (&offset_expr, "lui", LUI_FMT, tempreg, lui_reloc_type);
          macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
@@ -11474,8 +11473,8 @@ macro (struct mips_cl_insn *ip, char *str)
        }
       else if (mips_big_got && HAVE_NEWABI)
        {
-         int lui_reloc_type = (int) BFD_RELOC_MIPS_GOT_HI16;
-         int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT_LO16;
+         int lui_reloc_type = BFD_RELOC_MIPS_GOT_HI16;
+         int lw_reloc_type = BFD_RELOC_MIPS_GOT_LO16;
          int add_breg_early = 0;
 
          /* This is the large GOT case.  If this is a reference to an
@@ -11517,8 +11516,8 @@ macro (struct mips_cl_insn *ip, char *str)
          if (expr1.X_add_number == 0 && breg == 0
              && (call || tempreg == PIC_CALL_REG))
            {
-             lui_reloc_type = (int) BFD_RELOC_MIPS_CALL_HI16;
-             lw_reloc_type = (int) BFD_RELOC_MIPS_CALL_LO16;
+             lui_reloc_type = BFD_RELOC_MIPS_CALL_HI16;
+             lw_reloc_type = BFD_RELOC_MIPS_CALL_LO16;
            }
          macro_build (&offset_expr, "lui", LUI_FMT, tempreg, lui_reloc_type);
          macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t",
@@ -12532,7 +12531,7 @@ macro (struct mips_cl_insn *ip, char *str)
        }
       else if (!mips_big_got)
        {
-         int lw_reloc_type = (int) BFD_RELOC_MIPS_GOT16;
+         int lw_reloc_type = BFD_RELOC_MIPS_GOT16;
 
          /* If this is a reference to an external symbol, we want
               lw       $tempreg,<sym>($gp)     (BFD_RELOC_MIPS_GOT16)
index c4cf804005527b302babe12002163dd88025ba87..3c8834e2c0fecc96c970377c920337d4a7513a10 100644 (file)
@@ -2145,7 +2145,7 @@ md_assemble (char *str)
 
              fixP = fix_new_exp (frag_now, f - frag_now->fr_literal + offset,
                                  reloc_size / 8, &fixups[i].exp, pcrel,
-                                 ((bfd_reloc_code_real_type) reloc));
+                                 reloc);
 
              if (pcrel)
                fixP->fx_offset += offset;
index 0cfc82dedb0446ba4b8e7ecc536d5920d5961164..9dd884f42f9dfb109b95a8824c5d119964807cd0 100644 (file)
@@ -461,10 +461,10 @@ mt_apply_fix (fixS *fixP, valueT *valueP, segT seg)
 bool
 mt_fix_adjustable (fixS * fixP)
 {
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const CGEN_INSN *insn = NULL;
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand;
 
       operand = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex);
index bb5d387317b5a2ae69cc5e4bc24eb429dff13ab2..5a93b41786f2d35e3c2bd81c515c17c66f67e94a 100644 (file)
@@ -2298,7 +2298,7 @@ ppc_elf_suffix (char **str_p, expressionS *exp_p)
          }
        *str_p = str;
 
-       if (reloc == (int) BFD_RELOC_PPC64_TOC
+       if (reloc == BFD_RELOC_PPC64_TOC
            && exp_p->X_op == O_symbol
            && strcmp (S_GET_NAME (exp_p->X_add_symbol), ".TOC.") == 0)
          {
@@ -2311,7 +2311,7 @@ ppc_elf_suffix (char **str_p, expressionS *exp_p)
            && (ppc_cpu & PPC_OPCODE_POWER10) == 0)
          reloc = BFD_RELOC_PPC64_REL24_P9NOTOC;
 
-       return (bfd_reloc_code_real_type) reloc;
+       return reloc;
       }
 
   return BFD_RELOC_NONE;
@@ -2779,7 +2779,7 @@ ppc_xcoff_suffix (char **str_p)
        && (ppc_obj64 ? ptr->valid64 : ptr->valid32))
       {
        *str_p = str;
-       return (bfd_reloc_code_real_type) ptr->reloc;
+       return ptr->reloc;
       }
 
   return BFD_RELOC_NONE;
index 6e9dca029842e88166b26bfab0b012db8f71a5ec..4ddee63dd9e98cf9befa75ed8ed44882421b5570 100644 (file)
@@ -1906,8 +1906,7 @@ md_gather_operands (char *str,
        fixP = fix_new_exp (frag_now, f - frag_now->fr_literal, 4,
                            &fixups[i].exp,
                            (operand->flags & S390_OPERAND_PCREL) != 0,
-                           ((bfd_reloc_code_real_type)
-                            (fixups[i].opindex + (int) BFD_RELOC_UNUSED)));
+                           fixups[i].opindex + BFD_RELOC_UNUSED);
       /* s390_insert_operand () does the range checking.  */
       if (operand->flags & S390_OPERAND_PCREL)
        fixP->fx_no_overflow = 1;
@@ -2490,12 +2489,12 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
   else
     fixP->fx_done = 1;
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       const struct s390_operand *operand;
       int opindex;
 
-      opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       operand = &s390_operands[opindex];
 
       if (fixP->fx_done)
index a51985628992da7a08911ddc31708cfe5acaeb80..85a59ac034d7879b61f1387e94ca334acb36ed85 100644 (file)
@@ -3310,8 +3310,7 @@ md_assemble (char *str)
                       f - frag_now->fr_literal, 4,
                       & fixups[i].exp,
                       (operand->flags & V850_PCREL) != 0,
-                      (bfd_reloc_code_real_type) (fixups[i].opindex
-                                                  + (int) BFD_RELOC_UNUSED));
+                      fixups[i].opindex + BFD_RELOC_UNUSED);
        }
     }
 
@@ -3439,14 +3438,14 @@ md_apply_fix (fixS *fixP, valueT *valueP, segT seg ATTRIBUTE_UNUSED)
       fixP->fx_addnumber = value;
     }
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
       int opindex;
       const struct v850_operand *operand;
       unsigned long insn;
       const char *errmsg = NULL;
 
-      opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       operand = &v850_operands[opindex];
 
       /* Fetch the instruction, insert the fully resolved operand
index 83bf87386a6adc28b1d6a11d62ab13505b37eeff..f7807f5049d17ca76f80fddf69583b2f9ec4f77d 100644 (file)
@@ -481,9 +481,9 @@ xstormy16_md_apply_fix (fixS *   fixP,
   if (fixP->fx_subsy != (symbolS *) NULL)
     as_bad_subtract (fixP);
 
-  if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED)
+  if (fixP->fx_r_type >= BFD_RELOC_UNUSED)
     {
-      int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED;
+      int opindex = fixP->fx_r_type - BFD_RELOC_UNUSED;
       const CGEN_OPERAND *operand = cgen_operand_lookup_by_num (cd, opindex);
       const char *errmsg;
       bfd_reloc_code_real_type reloc_type;