Don't write to inferior_ptid in aix-thread.c
[deliverable/binutils-gdb.git] / gas / config / tc-sh.c
index 9b58db39d510cd1935ee3791c2619ea6599b2cde..42f7417c6e3795aaa5a885999cb75e50a161f0d3 100644 (file)
@@ -1,5 +1,5 @@
 /* tc-sh.c -- Assemble code for the Renesas / SuperH SH
-   Copyright (C) 1993-2018 Free Software Foundation, Inc.
+   Copyright (C) 1993-2020 Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
 
@@ -25,7 +25,6 @@
 #define DEFINE_TABLE
 #include "opcodes/sh-opc.h"
 #include "safe-ctype.h"
-#include "struc-symbol.h"
 
 #ifdef OBJ_ELF
 #include "elf/sh.h"
@@ -1911,6 +1910,7 @@ insert_loop_bounds (char *output, sh_operand_info *operand)
     {
       static int count = 0;
       char name[11];
+      expressionS *symval;
 
       /* If the last loop insn is a two-byte-insn, it is in danger of being
         swapped with the insn after it.  To prevent this, create a new
@@ -1926,8 +1926,9 @@ insert_loop_bounds (char *output, sh_operand_info *operand)
       SF_SET_LOCAL (end_sym);
 #endif /* OBJ_COFF */
       symbol_table_insert (end_sym);
-      end_sym->sy_value = operand[1].immediate;
-      end_sym->sy_value.X_add_number += 2;
+      symval = symbol_get_value_expression (end_sym);
+      *symval = operand[1].immediate;
+      symval->X_add_number += 2;
       fix_new (frag_now, frag_now_fix (), 2, end_sym, 0, 1, BFD_RELOC_SH_LABEL);
     }
 
@@ -2090,7 +2091,8 @@ build_Mytes (sh_opcode_info *opcode, sh_operand_info *operand)
            case IMM0_8BY2:
              insert (output + low_byte, BFD_RELOC_SH_IMM8BY2, 0, operand);
              break;
-           case IMM0_8:
+           case IMM0_8U:
+           case IMM0_8S:
              insert (output + low_byte, BFD_RELOC_SH_IMM8, 0, operand);
              break;
            case IMM1_8BY4:
@@ -2524,37 +2526,31 @@ md_assemble (char *str)
       char *name = initial_str;
       int name_length = 0;
       const sh_opcode_info *op;
-      int found = 0;
+      bfd_boolean found = FALSE;
 
-      /* identify opcode in string */
+      /* Identify opcode in string.  */
       while (ISSPACE (*name))
-       {
-         name++;
-       }
-      while (!ISSPACE (name[name_length]))
-       {
-         name_length++;
-       }
+       name++;
+
+      while (name[name_length] != '\0' && !ISSPACE (name[name_length]))
+       name_length++;
 
-      /* search for opcode in full list */
+      /* Search for opcode in full list.  */
       for (op = sh_table; op->name; op++)
        {
          if (strncasecmp (op->name, name, name_length) == 0
              && op->name[name_length] == '\0')
            {
-             found = 1;
+             found = TRUE;
              break;
            }
        }
 
-      if ( found )
-       {
-         as_bad (_("opcode not valid for this cpu variant"));
-       }
+      if (found)
+       as_bad (_("opcode not valid for this cpu variant"));
       else
-       {
-         as_bad (_("unknown opcode"));
-       }
+       as_bad (_("unknown opcode"));
+
       return;
     }
 
@@ -2923,21 +2919,6 @@ sh_frob_section (bfd *abfd ATTRIBUTE_UNUSED, segT sec,
   if (seginfo == NULL)
     return;
 
-  for (fix = seginfo->fix_root; fix != NULL; fix = fix->fx_next)
-    {
-      symbolS *sym;
-
-      sym = fix->fx_addsy;
-      /* Check for a local_symbol.  */
-      if (sym && sym->bsym == NULL)
-       {
-         struct local_symbol *ls = (struct local_symbol *)sym;
-         /* See if it's been converted.  If so, canonicalize.  */
-         if (local_symbol_converted_p (ls))
-           fix->fx_addsy = local_symbol_get_real_symbol (ls);
-       }
-    }
-
   for (fix = seginfo->fix_root; fix != NULL; fix = fix->fx_next)
     {
       symbolS *sym;
@@ -3100,7 +3081,7 @@ md_convert_frag (bfd *headers ATTRIBUTE_UNUSED, segT seg, fragS *fragP)
         differently from ones without delay slots.  */
       {
        unsigned char *buffer =
-         (unsigned char *) (fragP->fr_fix + fragP->fr_literal);
+         (unsigned char *) (fragP->fr_fix + &fragP->fr_literal[0]);
        int highbyte = target_big_endian ? 0 : 1;
        int lowbyte = target_big_endian ? 1 : 0;
        int delay = fragP->fr_subtype == C (COND_JUMP_DELAY, COND12);
@@ -3182,8 +3163,8 @@ md_section_align (segT seg ATTRIBUTE_UNUSED, valueT size)
 #ifdef OBJ_ELF
   return size;
 #else /* ! OBJ_ELF */
-  return ((size + (1 << bfd_get_section_alignment (stdoutput, seg)) - 1)
-         & -(1 << bfd_get_section_alignment (stdoutput, seg)));
+  return ((size + (1 << bfd_section_alignment (seg)) - 1)
+         & -(1 << bfd_section_alignment (seg)));
 #endif /* ! OBJ_ELF */
 }
 
This page took 0.044893 seconds and 4 git commands to generate.