[PATCH 2/3] RISC-V: Error and warning messages tidy.

Nelson Chu nelson.chu@sifive.com
Fri Jan 15 09:56:48 GMT 2021


Error and warning messages usually starting with lower case letter,
and without the period at the end.  Besides, add the prefixed "internel:"
at the beginning of the messages when they are caused internally.
Also fix indents and typos.

bfd/
    * elfnn-riscv.c (riscv_merge_attributes): Fix typos of messages.
gas/
    * config/tc-riscv.c: Error and warning messages tidy.
    * testsuite/gas/riscv/priv-reg-fail-fext.l: Updated.
    * testsuite/gas/riscv/priv-reg-fail-read-only-01.l: Likewise.
    * testsuite/gas/riscv/priv-reg-fail-read-only-02.l: Likewise.
    * testsuite/gas/riscv/priv-reg-fail-rv32-only.l: Likewise.
    * testsuite/gas/riscv/priv-reg-fail-version-1p10.l: Likewise.
    * testsuite/gas/riscv/priv-reg-fail-version-1p11.l: Likewise.
    * testsuite/gas/riscv/priv-reg-fail-version-1p9p1.l: Likewise.
ld/
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Updated.
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Likewise.
    * testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Likewise.
opcodes/
    * riscv-dis.c (parse_riscv_dis_option): Fix typos of message.
---
 bfd/ChangeLog                                      |   4 +
 bfd/elfnn-riscv.c                                  |   4 +-
 gas/ChangeLog                                      |  11 ++
 gas/config/tc-riscv.c                              | 124 ++++++++++---------
 gas/testsuite/gas/riscv/priv-reg-fail-fext.l       |   6 +-
 .../gas/riscv/priv-reg-fail-read-only-01.l         | 136 ++++++++++-----------
 .../gas/riscv/priv-reg-fail-read-only-02.l         |  48 ++++----
 gas/testsuite/gas/riscv/priv-reg-fail-rv32-only.l  | 130 ++++++++++----------
 .../gas/riscv/priv-reg-fail-version-1p10.l         |  48 ++++----
 .../gas/riscv/priv-reg-fail-version-1p11.l         |  46 +++----
 .../gas/riscv/priv-reg-fail-version-1p9p1.l        |  54 ++++----
 ld/ChangeLog                                       |   9 ++
 .../ld-riscv-elf/attr-merge-priv-spec-failed-01.d  |   4 +-
 .../ld-riscv-elf/attr-merge-priv-spec-failed-02.d  |   4 +-
 .../ld-riscv-elf/attr-merge-priv-spec-failed-03.d  |   4 +-
 .../ld-riscv-elf/attr-merge-priv-spec-failed-04.d  |   4 +-
 .../ld-riscv-elf/attr-merge-priv-spec-failed-05.d  |   4 +-
 .../ld-riscv-elf/attr-merge-priv-spec-failed-06.d  |   4 +-
 opcodes/ChangeLog                                  |   4 +
 opcodes/riscv-dis.c                                |   2 +-
 20 files changed, 343 insertions(+), 307 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 3f349ac1..37897cf 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,9 @@
 2021-01-15  Nelson Chu  <nelson.chu@sifive.com>
 
+	* elfnn-riscv.c (riscv_merge_attributes): Fix typos of messages.
+
+2021-01-15  Nelson Chu  <nelson.chu@sifive.com>
+
 	* elfnn-riscv.c: Comments tidy and improvement.
 	* elfxx-riscv.c: Likewise.
 	* elfxx-riscv.h: Likewise.
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index c0864c9..8b9819b 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -3704,7 +3704,7 @@ riscv_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
 		     && in_priv_spec != out_priv_spec)
 	      {
 		_bfd_error_handler
-		  (_("warning: %pB use privilege spec version %u.%u.%u but "
+		  (_("warning: %pB use privileged spec version %u.%u.%u but "
 		     "the output use version %u.%u.%u"),
 		   ibfd,
 		   in_attr[Tag_a].i,
@@ -3721,7 +3721,7 @@ riscv_merge_attributes (bfd *ibfd, struct bfd_link_info *info)
 		    || out_priv_spec == PRIV_SPEC_CLASS_1P9P1)
 		  {
 		    _bfd_error_handler
-		      (_("warning: privilege spec version 1.9.1 can not be "
+		      (_("warning: privileged spec version 1.9.1 can not be "
 			 "linked with other spec versions"));
 		  }
 
diff --git a/gas/ChangeLog b/gas/ChangeLog
index b1687c1..af2b676 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,16 @@
 2021-01-15  Nelson Chu  <nelson.chu@sifive.com>
 
+	* config/tc-riscv.c: Error and warning messages tidy.
+	* testsuite/gas/riscv/priv-reg-fail-fext.l: Updated.
+	* testsuite/gas/riscv/priv-reg-fail-read-only-01.l: Likewise.
+	* testsuite/gas/riscv/priv-reg-fail-read-only-02.l: Likewise.
+	* testsuite/gas/riscv/priv-reg-fail-rv32-only.l: Likewise.
+	* testsuite/gas/riscv/priv-reg-fail-version-1p10.l: Likewise.
+	* testsuite/gas/riscv/priv-reg-fail-version-1p11.l: Likewise.
+	* testsuite/gas/riscv/priv-reg-fail-version-1p9p1.l: Likewise.
+
+2021-01-15  Nelson Chu  <nelson.chu@sifive.com>
+
 	* config/tc-riscv.c: Comments tidy and improvement.  Also update
 	comment "fallthru" to "Fall through" that end with a period and
 	two spaces.
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index e9f5ab8..aa4b71a 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -108,8 +108,8 @@ riscv_set_default_isa_spec (const char *s)
   enum riscv_isa_spec_class class;
   if (!riscv_get_isa_spec_class (s, &class))
     {
-      as_bad ("Unknown default ISA spec `%s' set by "
-             "-misa-spec or --with-isa-spec", s);
+      as_bad ("unknown default ISA spec `%s' set by "
+	      "-misa-spec or --with-isa-spec", s);
       return 0;
     }
   else
@@ -136,8 +136,8 @@ riscv_set_default_priv_spec (const char *s)
 
   if (s != NULL)
     {
-      as_bad (_("Unknown default privilege spec `%s' set by "
-               "-mpriv-spec or --with-priv-spec"), s);
+      as_bad (_("unknown default privileged spec `%s' set by "
+		"-mpriv-spec or --with-priv-spec"), s);
       return 0;
     }
 
@@ -160,8 +160,8 @@ riscv_set_default_priv_spec (const char *s)
     }
 
   /* Still can not find the privileged spec class.  */
-  as_bad (_("Unknown default privilege spec `%d.%d.%d' set by "
-           "privilege attributes"),  major, minor, revision);
+  as_bad (_("unknown default privileged spec `%d.%d.%d' set by "
+	    "privileged elf attributes"), major, minor, revision);
   return 0;
 }
 
@@ -252,7 +252,7 @@ riscv_multi_subset_supports (enum riscv_insn_class insn_class)
 	      || riscv_subset_supports ("zbb"));
 
     default:
-      as_fatal ("Unreachable");
+      as_fatal ("internal: unreachable");
       return FALSE;
     }
 }
@@ -270,7 +270,7 @@ init_ext_version_hash (const struct riscv_ext_version *table)
     {
       const char *name = table[i].name;
       if (str_hash_insert (hash, name, &table[i], 0) != NULL)
-	as_fatal (_("duplicate %s"), name);
+	as_fatal (_("internal: duplicate %s"), name);
 
       i++;
       while (table[i].name
@@ -622,7 +622,7 @@ init_opcode_names_hash (void)
 
   for (opcode = &opcode_name_list[0]; opcode->name != NULL; ++opcode)
     if (str_hash_insert (opcode_names_hash, opcode->name, opcode, 0) != NULL)
-      as_fatal (_("duplicate %s"), opcode->name);
+      as_fatal (_("internal: duplicate %s"), opcode->name);
 }
 
 /* Find `s` is a valid opcode name or not, return the opcode name info
@@ -680,7 +680,7 @@ hash_reg_name (enum reg_class class, const char *name, unsigned n)
 {
   void *hash = ENCODE_REG_HASH (class, n);
   if (str_hash_insert (reg_names_hash, name, hash, 0) != NULL)
-    as_fatal (_("duplicate %s"), name);
+    as_fatal (_("internal: duplicate %s"), name);
 }
 
 static void
@@ -773,7 +773,7 @@ riscv_csr_address (const char *csr_name,
     }
 
   if (riscv_opts.csr_check && !result)
-    as_warn (_("Invalid CSR `%s' for the current ISA"), csr_name);
+    as_warn (_("invalid CSR `%s' for the current ISA"), csr_name);
 
   while (entry != NULL)
     {
@@ -794,7 +794,7 @@ riscv_csr_address (const char *csr_name,
       const char *priv_name = riscv_get_priv_spec_name (default_priv_spec);
 
       if (priv_name != NULL)
-	as_warn (_("Invalid CSR `%s' for the privilege spec `%s'"),
+	as_warn (_("invalid CSR `%s' for the privileged spec `%s'"),
 		 csr_name, priv_name);
     }
 
@@ -953,14 +953,15 @@ validate_riscv_insn (const struct riscv_opcode *opc, int length)
 		case '3': USE_BITS (OP_MASK_CFUNCT3, OP_SH_CFUNCT3); break;
 		case '2': USE_BITS (OP_MASK_CFUNCT2, OP_SH_CFUNCT2); break;
 		default:
-		  as_bad (_("internal: bad RISC-V opcode"
-			    " (unknown operand type `CF%c'): %s %s"),
+		  as_bad (_("internal: bad RISC-V opcode "
+			    "(unknown operand type `CF%c'): %s %s"),
 			  c, opc->name, opc->args);
 		  return FALSE;
 	      }
 	    break;
 	  default:
-	    as_bad (_("internal: bad RISC-V opcode (unknown operand type `C%c'): %s %s"),
+	    as_bad (_("internal: bad RISC-V opcode "
+		      "(unknown operand type `C%c'): %s %s"),
 		    c, opc->name, opc->args);
 	    return FALSE;
 	  }
@@ -1005,8 +1006,8 @@ validate_riscv_insn (const struct riscv_opcode *opc, int length)
 	    case '3': USE_BITS (OP_MASK_FUNCT3, OP_SH_FUNCT3); break;
 	    case '2': USE_BITS (OP_MASK_FUNCT2, OP_SH_FUNCT2); break;
 	    default:
-	      as_bad (_("internal: bad RISC-V opcode"
-			" (unknown operand type `F%c'): %s %s"),
+	      as_bad (_("internal: bad RISC-V opcode "
+			"(unknown operand type `F%c'): %s %s"),
 		      c, opc->name, opc->args);
 	    return FALSE;
 	  }
@@ -1017,8 +1018,8 @@ validate_riscv_insn (const struct riscv_opcode *opc, int length)
 	    case '4': USE_BITS (OP_MASK_OP, OP_SH_OP); break;
 	    case '2': USE_BITS (OP_MASK_OP2, OP_SH_OP2); break;
 	    default:
-	      as_bad (_("internal: bad RISC-V opcode"
-			" (unknown operand type `F%c'): %s %s"),
+	      as_bad (_("internal: bad RISC-V opcode "
+			"(unknown operand type `F%c'): %s %s"),
 		      c, opc->name, opc->args);
 	     return FALSE;
 	  }
@@ -1032,7 +1033,8 @@ validate_riscv_insn (const struct riscv_opcode *opc, int length)
 #undef USE_BITS
   if (used_bits != required_bits)
     {
-      as_bad (_("internal: bad RISC-V opcode (bits 0x%lx undefined): %s %s"),
+      as_bad (_("internal: bad RISC-V opcode "
+		"(bits 0x%lx undefined): %s %s"),
 	      ~(unsigned long)(used_bits & required_bits),
 	      opc->name, opc->args);
       return FALSE;
@@ -1060,7 +1062,7 @@ init_opcode_hash (const struct riscv_opcode *opcodes,
     {
       const char *name = opcodes[i].name;
       if (str_hash_insert (hash, name, &opcodes[i], 0) != NULL)
-	as_fatal (_("duplicate %s"), name);
+	as_fatal (_("internal: duplicate %s"), name);
 
       do
 	{
@@ -1071,7 +1073,8 @@ init_opcode_hash (const struct riscv_opcode *opcodes,
 	      else
 		length = 0; /* Let assembler determine the length.  */
 	      if (!validate_riscv_insn (&opcodes[i], length))
-		as_fatal (_("Broken assembler.  No assembly attempted."));
+		as_fatal (_("internal: broken assembler.  "
+			    "No assembly attempted"));
 	    }
 	  else
 	    gas_assert (!insn_directive_p);
@@ -1092,7 +1095,7 @@ md_begin (void)
   unsigned long mach = xlen == 64 ? bfd_mach_riscv64 : bfd_mach_riscv32;
 
   if (! bfd_set_arch_mach (stdoutput, bfd_arch_riscv, mach))
-    as_warn (_("Could not set architecture and machine"));
+    as_warn (_("could not set architecture and machine"));
 
   op_hash = init_opcode_hash (riscv_opcodes, FALSE);
   insn_type_hash = init_opcode_hash (riscv_insn_types, TRUE);
@@ -1181,7 +1184,8 @@ append_insn (struct riscv_cl_insn *ip, expressionS *address_expr,
 	{
 	  howto = bfd_reloc_type_lookup (stdoutput, reloc_type);
 	  if (howto == NULL)
-	    as_bad (_("Unsupported RISC-V relocation number %d"), reloc_type);
+	    as_bad (_("internal: usupported RISC-V relocation number %d"),
+		    reloc_type);
 
 	  ip->fixp = fix_new_exp (ip->frag, ip->where,
 				  bfd_get_reloc_size (howto),
@@ -1266,7 +1270,7 @@ macro_build (expressionS *ep, const char *name, const char *fmt, ...)
 	case ',':
 	  continue;
 	default:
-	  as_fatal (_("internal error: invalid macro"));
+	  as_fatal (_("internal: invalid macro"));
 	}
       break;
     }
@@ -1291,7 +1295,7 @@ md_assemblef (const char *format, ...)
   r = vasprintf (&buf, format, ap);
 
   if (r < 0)
-    as_fatal (_("internal error: vasprintf failed"));
+    as_fatal (_("internal: vasprintf failed"));
 
   md_assemble (buf);
   free(buf);
@@ -1326,7 +1330,7 @@ check_absolute_expr (struct riscv_cl_insn *ip, expressionS *ex,
     as_bad (_("unknown CSR `%s'"),
 	    S_GET_NAME (ex->X_add_symbol));
   else if (ex->X_op != O_constant)
-    as_bad (_("Instruction %s requires absolute expression"),
+    as_bad (_("instruction %s requires absolute expression"),
 	    ip->insn_mo->name);
   normalize_constant_expr (ex);
 }
@@ -1593,7 +1597,7 @@ macro (struct riscv_cl_insn *ip, expressionS *imm_expr,
       break;
 
     default:
-      as_bad (_("Macro %s not implemented"), ip->insn_mo->name);
+      as_bad (_("internal: macro %s not implemented"), ip->insn_mo->name);
       break;
     }
 }
@@ -1660,8 +1664,8 @@ parse_relocation (char **str, bfd_reloc_code_real_type *reloc,
 	if (*reloc != BFD_RELOC_UNUSED
 	    && !bfd_reloc_type_lookup (stdoutput, *reloc))
 	  {
-	    as_bad ("relocation %s isn't supported by the current ABI",
-		    percent_op->str);
+	    as_bad ("internal: relocation %s isn't supported by the "
+		    "current ABI", percent_op->str);
 	    *reloc = BFD_RELOC_UNUSED;
 	  }
 	return TRUE;
@@ -1936,7 +1940,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 			 report the detailed warning message here.  */
 		      if (save_c)
 			*(argsStart - 1) = save_c;
-		      as_warn (_("Read-only CSR is written `%s'"), str);
+		      as_warn (_("read-only CSR is written `%s'"), str);
 		      insn_with_csr = FALSE;
 		    }
 		}
@@ -2176,8 +2180,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 			    || imm_expr->X_add_number < 0
 			    || imm_expr->X_add_number >= 64)
 			  {
-			    as_bad (_("bad value for funct6 field, "
-				      "value must be 0...64"));
+			    as_bad (_("bad value for compressed funct6 "
+				      "field, value must be 0...64"));
 			    break;
 			  }
 
@@ -2191,8 +2195,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 			    || imm_expr->X_add_number < 0
 			    || imm_expr->X_add_number >= 16)
 			  {
-			    as_bad (_("bad value for funct4 field, "
-				      "value must be 0...15"));
+			    as_bad (_("bad value for compressed funct4 "
+				      "field, value must be 0...15"));
 			    break;
 			  }
 
@@ -2206,8 +2210,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 			    || imm_expr->X_add_number < 0
 			    || imm_expr->X_add_number >= 8)
 			  {
-			    as_bad (_("bad value for funct3 field, "
-				      "value must be 0...7"));
+			    as_bad (_("bad value for compressed funct3 "
+				      "field, value must be 0...7"));
 			    break;
 			  }
 			INSERT_OPERAND (CFUNCT3, *ip, imm_expr->X_add_number);
@@ -2220,8 +2224,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 			    || imm_expr->X_add_number < 0
 			    || imm_expr->X_add_number >= 4)
 			  {
-			    as_bad (_("bad value for funct2 field, "
-				      "value must be 0...3"));
+			    as_bad (_("bad value for compressed funct2 "
+				      "field, value must be 0...3"));
 			    break;
 			  }
 			INSERT_OPERAND (CFUNCT2, *ip, imm_expr->X_add_number);
@@ -2229,14 +2233,14 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 			s = expr_end;
 			continue;
 		      default:
-			as_bad (_("bad compressed FUNCT field"
-				  " specifier 'CF%c'\n"),
-				*args);
+			as_bad (_("internal: unknown compressed funct "
+				  "field specifier `CF%c'"), *args);
 		    }
 		  break;
 
 		default:
-		  as_bad (_("bad RVC field specifier 'C%c'\n"), *args);
+		  as_bad (_("internal: unknown compressed field "
+			    "specifier `C%c'"), *args);
 		}
 	      break;
 
@@ -2259,7 +2263,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 	      my_getExpression (imm_expr, s);
 	      check_absolute_expr (ip, imm_expr, FALSE);
 	      if ((unsigned long) imm_expr->X_add_number > 31)
-		as_bad (_("Improper shift amount (%lu)"),
+		as_bad (_("improper shift amount (%lu)"),
 			(unsigned long) imm_expr->X_add_number);
 	      INSERT_OPERAND (SHAMTW, *ip, imm_expr->X_add_number);
 	      imm_expr->X_op = O_absent;
@@ -2270,7 +2274,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 	      my_getExpression (imm_expr, s);
 	      check_absolute_expr (ip, imm_expr, FALSE);
 	      if ((unsigned long) imm_expr->X_add_number >= xlen)
-		as_bad (_("Improper shift amount (%lu)"),
+		as_bad (_("improper shift amount (%lu)"),
 			(unsigned long) imm_expr->X_add_number);
 	      INSERT_OPERAND (SHAMT, *ip, imm_expr->X_add_number);
 	      imm_expr->X_op = O_absent;
@@ -2281,7 +2285,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 	      my_getExpression (imm_expr, s);
 	      check_absolute_expr (ip, imm_expr, FALSE);
 	      if ((unsigned long) imm_expr->X_add_number > 31)
-		as_bad (_("Improper CSRxI immediate (%lu)"),
+		as_bad (_("improper CSRxI immediate (%lu)"),
 			(unsigned long) imm_expr->X_add_number);
 	      INSERT_OPERAND (RS1, *ip, imm_expr->X_add_number);
 	      imm_expr->X_op = O_absent;
@@ -2298,7 +2302,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 		  my_getExpression (imm_expr, s);
 		  check_absolute_expr (ip, imm_expr, TRUE);
 		  if ((unsigned long) imm_expr->X_add_number > 0xfff)
-		    as_bad (_("Improper CSR address (%lu)"),
+		    as_bad (_("improper CSR address (%lu)"),
 			    (unsigned long) imm_expr->X_add_number);
 		  INSERT_OPERAND (CSR, *ip, imm_expr->X_add_number);
 		  imm_expr->X_op = O_absent;
@@ -2540,7 +2544,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 		  s = expr_end;
 		  continue;
 		default:
-		  as_bad (_("bad Opcode field specifier 'O%c'\n"), *args);
+		  as_bad (_("internal: unknown opcode field "
+			    "specifier `O%c'"), *args);
 		}
 	      break;
 
@@ -2594,7 +2599,8 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 		  continue;
 
 		default:
-		  as_bad (_("bad FUNCT field specifier 'F%c'\n"), *args);
+		  as_bad (_("internal: unknown funct field "
+			    "specifier `F%c'\n"), *args);
 		}
 	      break;
 
@@ -2608,7 +2614,7 @@ riscv_ip (char *str, struct riscv_cl_insn *ip, expressionS *imm_expr,
 	      continue;
 
 	    default:
-	      as_fatal (_("internal error: bad argument type %c"), *args);
+	      as_fatal (_("internal: unknown argument type `%c'"), *args);
 	    }
 	  break;
 	}
@@ -3002,7 +3008,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
 		      fixP->fx_next->fx_r_type = BFD_RELOC_RISCV_SUB6;
 		    }
 		  else
-		    as_fatal (_("internal error: bad CFA value #%d"), subtype);
+		    as_fatal (_("internal: bad CFA value #%d"), subtype);
 		  break;
 		}
 	      break;
@@ -3083,7 +3089,7 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
     default:
       /* We ignore generic BFD relocations we don't know about.  */
       if (bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type) != NULL)
-	as_fatal (_("internal error: bad relocation #%d"), fixP->fx_r_type);
+	as_fatal (_("internal: bad relocation #%d"), fixP->fx_r_type);
     }
 
   if (fixP->fx_subsy != NULL)
@@ -3207,7 +3213,7 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
     }
   else
     {
-      as_warn (_("Unrecognized .option directive: %s\n"), name);
+      as_warn (_("unrecognized .option directive: %s\n"), name);
     }
   *input_line_pointer = ch;
   demand_empty_rest_of_line ();
@@ -3227,7 +3233,7 @@ s_dtprel (int bytes)
 
   if (ex.X_op != O_symbol)
     {
-      as_bad (_("Unsupported use of %s"), (bytes == 8
+      as_bad (_("unsupported use of %s"), (bytes == 8
 					   ? ".dtpreldword"
 					   : ".dtprelword"));
       ignore_rest_of_line ();
@@ -3668,7 +3674,7 @@ riscv_write_out_attrs (void)
        number = (number * 10) + (*p - '0');
       else
        {
-         as_bad (_("internal: bad RISC-V priv spec string (%s)"), priv_str);
+         as_bad (_("internal: bad RISC-V privileged spec (%s)"), priv_str);
          return;
        }
     }
@@ -3752,7 +3758,8 @@ s_riscv_attribute (int ignored ATTRIBUTE_UNUSED)
       if (!start_assemble)
 	riscv_set_arch (attr[Tag_RISCV_arch].s);
       else
-	as_fatal (_(".attribute arch must set before any instructions"));
+	as_fatal (_("architecture elf attributes must set before "
+		    "any instructions"));
 
       if (old_xlen != xlen)
 	{
@@ -3761,7 +3768,7 @@ s_riscv_attribute (int ignored ATTRIBUTE_UNUSED)
 	  bfd_find_target (riscv_target_format (), stdoutput);
 
 	  if (! bfd_set_arch_mach (stdoutput, bfd_arch_riscv, mach))
-	    as_warn (_("Could not set architecture and machine"));
+	    as_warn (_("could not set architecture and machine"));
 	}
       break;
 
@@ -3769,7 +3776,8 @@ s_riscv_attribute (int ignored ATTRIBUTE_UNUSED)
     case Tag_RISCV_priv_spec_minor:
     case Tag_RISCV_priv_spec_revision:
       if (start_assemble)
-       as_fatal (_(".attribute priv spec must set before any instructions"));
+       as_fatal (_("privileged elf attributes must set before "
+		   "any instructions"));
       break;
 
     default:
diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-fext.l b/gas/testsuite/gas/riscv/priv-reg-fail-fext.l
index 2ee0dae..c44f44d 100644
--- a/gas/testsuite/gas/riscv/priv-reg-fail-fext.l
+++ b/gas/testsuite/gas/riscv/priv-reg-fail-fext.l
@@ -1,6 +1,6 @@
 .*Assembler messages:
 #...
-.*Warning: Invalid CSR `fflags' for the current ISA
-.*Warning: Invalid CSR `frm' for the current ISA
-.*Warning: Invalid CSR `fcsr' for the current ISA
+.*Warning: invalid CSR `fflags' for the current ISA
+.*Warning: invalid CSR `frm' for the current ISA
+.*Warning: invalid CSR `fcsr' for the current ISA
 #...
diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.l b/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.l
index 305cd17..a0ca62f 100644
--- a/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.l
+++ b/gas/testsuite/gas/riscv/priv-reg-fail-read-only-01.l
@@ -1,71 +1,71 @@
 .*Assembler messages:
 #...
-.*Warning: Read-only CSR is written `csrw cycle,a1'
-.*Warning: Read-only CSR is written `csrw time,a1'
-.*Warning: Read-only CSR is written `csrw instret,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter3,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter4,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter5,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter6,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter7,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter8,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter9,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter10,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter11,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter12,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter13,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter14,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter15,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter16,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter17,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter18,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter19,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter20,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter21,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter22,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter23,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter24,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter25,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter26,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter27,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter28,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter29,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter30,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter31,a1'
-.*Warning: Read-only CSR is written `csrw cycleh,a1'
-.*Warning: Read-only CSR is written `csrw timeh,a1'
-.*Warning: Read-only CSR is written `csrw instreth,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter3h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter4h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter5h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter6h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter7h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter8h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter9h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter10h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter11h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter12h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter13h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter14h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter15h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter16h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter17h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter18h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter19h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter20h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter21h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter22h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter23h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter24h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter25h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter26h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter27h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter28h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter29h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter30h,a1'
-.*Warning: Read-only CSR is written `csrw hpmcounter31h,a1'
-.*Warning: Read-only CSR is written `csrw mvendorid,a1'
-.*Warning: Read-only CSR is written `csrw marchid,a1'
-.*Warning: Read-only CSR is written `csrw mimpid,a1'
-.*Warning: Read-only CSR is written `csrw mhartid,a1'
+.*Warning: read-only CSR is written `csrw cycle,a1'
+.*Warning: read-only CSR is written `csrw time,a1'
+.*Warning: read-only CSR is written `csrw instret,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter3,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter4,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter5,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter6,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter7,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter8,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter9,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter10,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter11,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter12,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter13,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter14,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter15,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter16,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter17,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter18,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter19,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter20,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter21,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter22,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter23,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter24,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter25,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter26,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter27,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter28,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter29,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter30,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter31,a1'
+.*Warning: read-only CSR is written `csrw cycleh,a1'
+.*Warning: read-only CSR is written `csrw timeh,a1'
+.*Warning: read-only CSR is written `csrw instreth,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter3h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter4h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter5h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter6h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter7h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter8h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter9h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter10h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter11h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter12h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter13h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter14h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter15h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter16h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter17h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter18h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter19h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter20h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter21h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter22h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter23h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter24h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter25h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter26h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter27h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter28h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter29h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter30h,a1'
+.*Warning: read-only CSR is written `csrw hpmcounter31h,a1'
+.*Warning: read-only CSR is written `csrw mvendorid,a1'
+.*Warning: read-only CSR is written `csrw marchid,a1'
+.*Warning: read-only CSR is written `csrw mimpid,a1'
+.*Warning: read-only CSR is written `csrw mhartid,a1'
 #...
diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-read-only-02.l b/gas/testsuite/gas/riscv/priv-reg-fail-read-only-02.l
index 660f19d..96f83a9 100644
--- a/gas/testsuite/gas/riscv/priv-reg-fail-read-only-02.l
+++ b/gas/testsuite/gas/riscv/priv-reg-fail-read-only-02.l
@@ -1,25 +1,25 @@
 .*Assembler messages:
-.*Warning: Read-only CSR is written `csrrw a0,cycle,a1'
-.*Warning: Read-only CSR is written `csrrw a0,cycle,zero'
-.*Warning: Read-only CSR is written `csrrw zero,cycle,a1'
-.*Warning: Read-only CSR is written `csrrw zero,cycle,zero'
-.*Warning: Read-only CSR is written `csrw cycle,a1'
-.*Warning: Read-only CSR is written `csrw cycle,zero'
-.*Warning: Read-only CSR is written `csrrwi a0,cycle,0xb'
-.*Warning: Read-only CSR is written `csrrwi a0,cycle,0x0'
-.*Warning: Read-only CSR is written `csrrwi zero,cycle,0xb'
-.*Warning: Read-only CSR is written `csrrwi zero,cycle,0x0'
-.*Warning: Read-only CSR is written `csrwi cycle,0xb'
-.*Warning: Read-only CSR is written `csrwi cycle,0x0'
-.*Warning: Read-only CSR is written `csrrs a0,cycle,a1'
-.*Warning: Read-only CSR is written `csrrs zero,cycle,a1'
-.*Warning: Read-only CSR is written `csrs cycle,a0'
-.*Warning: Read-only CSR is written `csrrsi a0,cycle,0xb'
-.*Warning: Read-only CSR is written `csrrsi zero,cycle,0xb'
-.*Warning: Read-only CSR is written `csrsi cycle,0xb'
-.*Warning: Read-only CSR is written `csrrc a0,cycle,a1'
-.*Warning: Read-only CSR is written `csrrc zero,cycle,a1'
-.*Warning: Read-only CSR is written `csrc cycle,a0'
-.*Warning: Read-only CSR is written `csrrci a0,cycle,0xb'
-.*Warning: Read-only CSR is written `csrrci zero,cycle,0xb'
-.*Warning: Read-only CSR is written `csrci cycle,0xb'
+.*Warning: read-only CSR is written `csrrw a0,cycle,a1'
+.*Warning: read-only CSR is written `csrrw a0,cycle,zero'
+.*Warning: read-only CSR is written `csrrw zero,cycle,a1'
+.*Warning: read-only CSR is written `csrrw zero,cycle,zero'
+.*Warning: read-only CSR is written `csrw cycle,a1'
+.*Warning: read-only CSR is written `csrw cycle,zero'
+.*Warning: read-only CSR is written `csrrwi a0,cycle,0xb'
+.*Warning: read-only CSR is written `csrrwi a0,cycle,0x0'
+.*Warning: read-only CSR is written `csrrwi zero,cycle,0xb'
+.*Warning: read-only CSR is written `csrrwi zero,cycle,0x0'
+.*Warning: read-only CSR is written `csrwi cycle,0xb'
+.*Warning: read-only CSR is written `csrwi cycle,0x0'
+.*Warning: read-only CSR is written `csrrs a0,cycle,a1'
+.*Warning: read-only CSR is written `csrrs zero,cycle,a1'
+.*Warning: read-only CSR is written `csrs cycle,a0'
+.*Warning: read-only CSR is written `csrrsi a0,cycle,0xb'
+.*Warning: read-only CSR is written `csrrsi zero,cycle,0xb'
+.*Warning: read-only CSR is written `csrsi cycle,0xb'
+.*Warning: read-only CSR is written `csrrc a0,cycle,a1'
+.*Warning: read-only CSR is written `csrrc zero,cycle,a1'
+.*Warning: read-only CSR is written `csrc cycle,a0'
+.*Warning: read-only CSR is written `csrrci a0,cycle,0xb'
+.*Warning: read-only CSR is written `csrrci zero,cycle,0xb'
+.*Warning: read-only CSR is written `csrci cycle,0xb'
diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-rv32-only.l b/gas/testsuite/gas/riscv/priv-reg-fail-rv32-only.l
index 5dec50f..70fd776 100644
--- a/gas/testsuite/gas/riscv/priv-reg-fail-rv32-only.l
+++ b/gas/testsuite/gas/riscv/priv-reg-fail-rv32-only.l
@@ -1,68 +1,68 @@
 .*Assembler messages:
 #...
-.*Warning: Invalid CSR `cycleh' for the current ISA
-.*Warning: Invalid CSR `timeh' for the current ISA
-.*Warning: Invalid CSR `instreth' for the current ISA
-.*Warning: Invalid CSR `hpmcounter3h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter4h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter5h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter6h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter7h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter8h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter9h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter10h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter11h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter12h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter13h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter14h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter15h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter16h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter17h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter18h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter19h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter20h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter21h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter22h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter23h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter24h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter25h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter26h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter27h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter28h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter29h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter30h' for the current ISA
-.*Warning: Invalid CSR `hpmcounter31h' for the current ISA
-.*Warning: Invalid CSR `pmpcfg1' for the current ISA
-.*Warning: Invalid CSR `pmpcfg3' for the current ISA
-.*Warning: Invalid CSR `mcycleh' for the current ISA
-.*Warning: Invalid CSR `minstreth' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter3h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter4h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter5h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter6h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter7h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter8h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter9h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter10h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter11h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter12h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter13h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter14h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter15h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter16h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter17h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter18h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter19h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter20h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter21h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter22h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter23h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter24h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter25h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter26h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter27h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter28h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter29h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter30h' for the current ISA
-.*Warning: Invalid CSR `mhpmcounter31h' for the current ISA
+.*Warning: invalid CSR `cycleh' for the current ISA
+.*Warning: invalid CSR `timeh' for the current ISA
+.*Warning: invalid CSR `instreth' for the current ISA
+.*Warning: invalid CSR `hpmcounter3h' for the current ISA
+.*Warning: invalid CSR `hpmcounter4h' for the current ISA
+.*Warning: invalid CSR `hpmcounter5h' for the current ISA
+.*Warning: invalid CSR `hpmcounter6h' for the current ISA
+.*Warning: invalid CSR `hpmcounter7h' for the current ISA
+.*Warning: invalid CSR `hpmcounter8h' for the current ISA
+.*Warning: invalid CSR `hpmcounter9h' for the current ISA
+.*Warning: invalid CSR `hpmcounter10h' for the current ISA
+.*Warning: invalid CSR `hpmcounter11h' for the current ISA
+.*Warning: invalid CSR `hpmcounter12h' for the current ISA
+.*Warning: invalid CSR `hpmcounter13h' for the current ISA
+.*Warning: invalid CSR `hpmcounter14h' for the current ISA
+.*Warning: invalid CSR `hpmcounter15h' for the current ISA
+.*Warning: invalid CSR `hpmcounter16h' for the current ISA
+.*Warning: invalid CSR `hpmcounter17h' for the current ISA
+.*Warning: invalid CSR `hpmcounter18h' for the current ISA
+.*Warning: invalid CSR `hpmcounter19h' for the current ISA
+.*Warning: invalid CSR `hpmcounter20h' for the current ISA
+.*Warning: invalid CSR `hpmcounter21h' for the current ISA
+.*Warning: invalid CSR `hpmcounter22h' for the current ISA
+.*Warning: invalid CSR `hpmcounter23h' for the current ISA
+.*Warning: invalid CSR `hpmcounter24h' for the current ISA
+.*Warning: invalid CSR `hpmcounter25h' for the current ISA
+.*Warning: invalid CSR `hpmcounter26h' for the current ISA
+.*Warning: invalid CSR `hpmcounter27h' for the current ISA
+.*Warning: invalid CSR `hpmcounter28h' for the current ISA
+.*Warning: invalid CSR `hpmcounter29h' for the current ISA
+.*Warning: invalid CSR `hpmcounter30h' for the current ISA
+.*Warning: invalid CSR `hpmcounter31h' for the current ISA
+.*Warning: invalid CSR `pmpcfg1' for the current ISA
+.*Warning: invalid CSR `pmpcfg3' for the current ISA
+.*Warning: invalid CSR `mcycleh' for the current ISA
+.*Warning: invalid CSR `minstreth' for the current ISA
+.*Warning: invalid CSR `mhpmcounter3h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter4h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter5h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter6h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter7h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter8h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter9h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter10h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter11h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter12h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter13h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter14h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter15h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter16h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter17h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter18h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter19h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter20h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter21h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter22h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter23h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter24h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter25h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter26h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter27h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter28h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter29h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter30h' for the current ISA
+.*Warning: invalid CSR `mhpmcounter31h' for the current ISA
 #...
diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l
index 983f593..fbba6e5 100644
--- a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l
+++ b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p10.l
@@ -1,25 +1,25 @@
 .*Assembler messages:
-.*Warning: Invalid CSR `mcountinhibit' for the privilege spec `1.10'
-.*Warning: Invalid CSR `ubadaddr' for the privilege spec `1.10'
-.*Warning: Invalid CSR `sbadaddr' for the privilege spec `1.10'
-.*Warning: Invalid CSR `sptbr' for the privilege spec `1.10'
-.*Warning: Invalid CSR `mbadaddr' for the privilege spec `1.10'
-.*Warning: Invalid CSR `mucounteren' for the privilege spec `1.10'
-.*Warning: Invalid CSR `hstatus' for the privilege spec `1.10'
-.*Warning: Invalid CSR `hedeleg' for the privilege spec `1.10'
-.*Warning: Invalid CSR `hideleg' for the privilege spec `1.10'
-.*Warning: Invalid CSR `hie' for the privilege spec `1.10'
-.*Warning: Invalid CSR `htvec' for the privilege spec `1.10'
-.*Warning: Invalid CSR `hscratch' for the privilege spec `1.10'
-.*Warning: Invalid CSR `hepc' for the privilege spec `1.10'
-.*Warning: Invalid CSR `hcause' for the privilege spec `1.10'
-.*Warning: Invalid CSR `hbadaddr' for the privilege spec `1.10'
-.*Warning: Invalid CSR `hip' for the privilege spec `1.10'
-.*Warning: Invalid CSR `mbase' for the privilege spec `1.10'
-.*Warning: Invalid CSR `mbound' for the privilege spec `1.10'
-.*Warning: Invalid CSR `mibase' for the privilege spec `1.10'
-.*Warning: Invalid CSR `mibound' for the privilege spec `1.10'
-.*Warning: Invalid CSR `mdbase' for the privilege spec `1.10'
-.*Warning: Invalid CSR `mdbound' for the privilege spec `1.10'
-.*Warning: Invalid CSR `mscounteren' for the privilege spec `1.10'
-.*Warning: Invalid CSR `mhcounteren' for the privilege spec `1.10'
+.*Warning: invalid CSR `mcountinhibit' for the privileged spec `1.10'
+.*Warning: invalid CSR `ubadaddr' for the privileged spec `1.10'
+.*Warning: invalid CSR `sbadaddr' for the privileged spec `1.10'
+.*Warning: invalid CSR `sptbr' for the privileged spec `1.10'
+.*Warning: invalid CSR `mbadaddr' for the privileged spec `1.10'
+.*Warning: invalid CSR `mucounteren' for the privileged spec `1.10'
+.*Warning: invalid CSR `hstatus' for the privileged spec `1.10'
+.*Warning: invalid CSR `hedeleg' for the privileged spec `1.10'
+.*Warning: invalid CSR `hideleg' for the privileged spec `1.10'
+.*Warning: invalid CSR `hie' for the privileged spec `1.10'
+.*Warning: invalid CSR `htvec' for the privileged spec `1.10'
+.*Warning: invalid CSR `hscratch' for the privileged spec `1.10'
+.*Warning: invalid CSR `hepc' for the privileged spec `1.10'
+.*Warning: invalid CSR `hcause' for the privileged spec `1.10'
+.*Warning: invalid CSR `hbadaddr' for the privileged spec `1.10'
+.*Warning: invalid CSR `hip' for the privileged spec `1.10'
+.*Warning: invalid CSR `mbase' for the privileged spec `1.10'
+.*Warning: invalid CSR `mbound' for the privileged spec `1.10'
+.*Warning: invalid CSR `mibase' for the privileged spec `1.10'
+.*Warning: invalid CSR `mibound' for the privileged spec `1.10'
+.*Warning: invalid CSR `mdbase' for the privileged spec `1.10'
+.*Warning: invalid CSR `mdbound' for the privileged spec `1.10'
+.*Warning: invalid CSR `mscounteren' for the privileged spec `1.10'
+.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.10'
diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l
index 0e036e4..68354ce 100644
--- a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l
+++ b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p11.l
@@ -1,24 +1,24 @@
 .*Assembler messages:
-.*Warning: Invalid CSR `ubadaddr' for the privilege spec `1.11'
-.*Warning: Invalid CSR `sbadaddr' for the privilege spec `1.11'
-.*Warning: Invalid CSR `sptbr' for the privilege spec `1.11'
-.*Warning: Invalid CSR `mbadaddr' for the privilege spec `1.11'
-.*Warning: Invalid CSR `mucounteren' for the privilege spec `1.11'
-.*Warning: Invalid CSR `hstatus' for the privilege spec `1.11'
-.*Warning: Invalid CSR `hedeleg' for the privilege spec `1.11'
-.*Warning: Invalid CSR `hideleg' for the privilege spec `1.11'
-.*Warning: Invalid CSR `hie' for the privilege spec `1.11'
-.*Warning: Invalid CSR `htvec' for the privilege spec `1.11'
-.*Warning: Invalid CSR `hscratch' for the privilege spec `1.11'
-.*Warning: Invalid CSR `hepc' for the privilege spec `1.11'
-.*Warning: Invalid CSR `hcause' for the privilege spec `1.11'
-.*Warning: Invalid CSR `hbadaddr' for the privilege spec `1.11'
-.*Warning: Invalid CSR `hip' for the privilege spec `1.11'
-.*Warning: Invalid CSR `mbase' for the privilege spec `1.11'
-.*Warning: Invalid CSR `mbound' for the privilege spec `1.11'
-.*Warning: Invalid CSR `mibase' for the privilege spec `1.11'
-.*Warning: Invalid CSR `mibound' for the privilege spec `1.11'
-.*Warning: Invalid CSR `mdbase' for the privilege spec `1.11'
-.*Warning: Invalid CSR `mdbound' for the privilege spec `1.11'
-.*Warning: Invalid CSR `mscounteren' for the privilege spec `1.11'
-.*Warning: Invalid CSR `mhcounteren' for the privilege spec `1.11'
+.*Warning: invalid CSR `ubadaddr' for the privileged spec `1.11'
+.*Warning: invalid CSR `sbadaddr' for the privileged spec `1.11'
+.*Warning: invalid CSR `sptbr' for the privileged spec `1.11'
+.*Warning: invalid CSR `mbadaddr' for the privileged spec `1.11'
+.*Warning: invalid CSR `mucounteren' for the privileged spec `1.11'
+.*Warning: invalid CSR `hstatus' for the privileged spec `1.11'
+.*Warning: invalid CSR `hedeleg' for the privileged spec `1.11'
+.*Warning: invalid CSR `hideleg' for the privileged spec `1.11'
+.*Warning: invalid CSR `hie' for the privileged spec `1.11'
+.*Warning: invalid CSR `htvec' for the privileged spec `1.11'
+.*Warning: invalid CSR `hscratch' for the privileged spec `1.11'
+.*Warning: invalid CSR `hepc' for the privileged spec `1.11'
+.*Warning: invalid CSR `hcause' for the privileged spec `1.11'
+.*Warning: invalid CSR `hbadaddr' for the privileged spec `1.11'
+.*Warning: invalid CSR `hip' for the privileged spec `1.11'
+.*Warning: invalid CSR `mbase' for the privileged spec `1.11'
+.*Warning: invalid CSR `mbound' for the privileged spec `1.11'
+.*Warning: invalid CSR `mibase' for the privileged spec `1.11'
+.*Warning: invalid CSR `mibound' for the privileged spec `1.11'
+.*Warning: invalid CSR `mdbase' for the privileged spec `1.11'
+.*Warning: invalid CSR `mdbound' for the privileged spec `1.11'
+.*Warning: invalid CSR `mscounteren' for the privileged spec `1.11'
+.*Warning: invalid CSR `mhcounteren' for the privileged spec `1.11'
diff --git a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p9p1.l b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p9p1.l
index 8a8126a..817f664 100644
--- a/gas/testsuite/gas/riscv/priv-reg-fail-version-1p9p1.l
+++ b/gas/testsuite/gas/riscv/priv-reg-fail-version-1p9p1.l
@@ -1,28 +1,28 @@
 .*Assembler messages:
-.*Warning: Invalid CSR `utval' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `scounteren' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `stval' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `satp' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `mcounteren' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `mtval' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpcfg0' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpcfg1' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpcfg2' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpcfg3' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr0' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr1' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr2' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr3' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr4' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr5' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr6' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr7' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr8' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr9' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr10' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr11' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr12' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr13' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr14' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `pmpaddr15' for the privilege spec `1.9.1'
-.*Warning: Invalid CSR `mcountinhibit' for the privilege spec `1.9.1'
+.*Warning: invalid CSR `utval' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `scounteren' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `stval' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `satp' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `mcounteren' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `mtval' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpcfg0' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpcfg1' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpcfg2' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpcfg3' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr0' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr1' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr2' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr3' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr4' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr5' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr6' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr7' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr8' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr9' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr10' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr11' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr12' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr13' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr14' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `pmpaddr15' for the privileged spec `1.9.1'
+.*Warning: invalid CSR `mcountinhibit' for the privileged spec `1.9.1'
diff --git a/ld/ChangeLog b/ld/ChangeLog
index f856715..5a0f07f 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+2021-01-15  Nelson Chu  <nelson.chu@sifive.com>
+
+	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d: Updated.
+	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d: Likewise.
+	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d: Likewise.
+	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d: Likewise.
+	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d: Likewise.
+	* testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d: Likewise.
+
 2021-01-14  Nick Clifton  <nickc@redhat.com>
 
 	* po/fr.po: Updated French translation.
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d
index f3e2f2a..3509cae 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-01.d
@@ -2,8 +2,8 @@
 #source: attr-merge-priv-spec-c.s
 #as:
 #ld: -r
-#warning: .*use privilege spec version 1.11.0 but the output use version 1.9.1
-#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions
+#warning: .*use privileged spec version 1.11.0 but the output use version 1.9.1
+#warning: .*privileged spec version 1.9.1 can not be linked with other spec versions
 #readelf: -A
 
 Attribute Section: riscv
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d
index 9e98809..88defe1 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-02.d
@@ -2,8 +2,8 @@
 #source: attr-merge-priv-spec-a.s
 #as:
 #ld: -r
-#warning: .*use privilege spec version 1.9.1 but the output use version 1.11.0
-#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions
+#warning: .*use privileged spec version 1.9.1 but the output use version 1.11.0
+#warning: .*privileged spec version 1.9.1 can not be linked with other spec versions
 #readelf: -A
 
 Attribute Section: riscv
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d
index 05dffda..7a1b977 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-03.d
@@ -3,8 +3,8 @@
 #source: attr-merge-priv-spec-c.s
 #as:
 #ld: -r
-#warning: .*use privilege spec version 1.11.0 but the output use version 1.9.1
-#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions
+#warning: .*use privileged spec version 1.11.0 but the output use version 1.9.1
+#warning: .*privileged spec version 1.9.1 can not be linked with other spec versions
 #readelf: -A
 
 Attribute Section: riscv
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d
index ff10f3f..37b8afc 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-04.d
@@ -3,8 +3,8 @@
 #source: attr-merge-priv-spec-c.s
 #as:
 #ld: -r
-#warning: .*use privilege spec version 1.11.0 but the output use version 1.9.1
-#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions
+#warning: .*use privileged spec version 1.11.0 but the output use version 1.9.1
+#warning: .*privileged spec version 1.9.1 can not be linked with other spec versions
 #readelf: -A
 
 Attribute Section: riscv
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d
index 7c1cc56..30446c9 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-05.d
@@ -3,8 +3,8 @@
 #source: attr-merge-priv-spec-a.s
 #as:
 #ld: -r
-#warning: .*use privilege spec version 1.9.1 but the output use version 1.11.0
-#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions
+#warning: .*use privileged spec version 1.9.1 but the output use version 1.11.0
+#warning: .*privileged spec version 1.9.1 can not be linked with other spec versions
 #readelf: -A
 
 Attribute Section: riscv
diff --git a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d
index 1a81538..8c7624c 100644
--- a/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d
+++ b/ld/testsuite/ld-riscv-elf/attr-merge-priv-spec-failed-06.d
@@ -3,8 +3,8 @@
 #source: attr-merge-priv-spec-a.s
 #as:
 #ld: -r
-#warning: .*use privilege spec version 1.9.1 but the output use version 1.11.0
-#warning: .*privilege spec version 1.9.1 can not be linked with other spec versions
+#warning: .*use privileged spec version 1.9.1 but the output use version 1.11.0
+#warning: .*privileged spec version 1.9.1 can not be linked with other spec versions
 #readelf: -A
 
 Attribute Section: riscv
diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index 6a449ff..a229e1e 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,5 +1,9 @@
 2021-01-15  Nelson Chu  <nelson.chu@sifive.com>
 
+	* riscv-dis.c (parse_riscv_dis_option): Fix typos of message.
+
+2021-01-15  Nelson Chu  <nelson.chu@sifive.com>
+
 	* riscv-dis.c: Comments tidy and improvement.
 	* riscv-opc.c: Likewise.
 
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c
index d6d66e4..b5883c3 100644
--- a/opcodes/riscv-dis.c
+++ b/opcodes/riscv-dis.c
@@ -101,7 +101,7 @@ parse_riscv_dis_option (const char *option)
     {
       enum riscv_priv_spec_class priv_spec = PRIV_SPEC_CLASS_NONE;
       if (!riscv_get_priv_spec_class (value, &priv_spec))
-	opcodes_error_handler (_("unknown privilege spec set by %s=%s"),
+	opcodes_error_handler (_("unknown privileged spec set by %s=%s"),
 			       option, value);
       else if (default_priv_spec == PRIV_SPEC_CLASS_NONE)
 	default_priv_spec = priv_spec;
-- 
2.7.4



More information about the Binutils mailing list