[PATCH] RISC-V: Minor cleanup for s extension support.

Jim Wilson jimw@sifive.com
Fri Jan 24 22:25:00 GMT 2020


Looking at older versions of the patch, I confirmed that the odd comment
I referred to earlier was indeed from the removal of the sx support.  It
also explains an oddly formatted switch statement.  This patch fixes both
minor problems.

Tested with riscv{32,64}-{elf,linux} cross build and check with no
regressions.

Committed.

Jim

	bfd/
	* elfxx-riscv.c (riscv_get_prefix_class): Format s case like others.
	(riscv_parse_prefixed_ext): Fix s extension comment and reword to
	avoid over long line.

Change-Id: Ibfef1dbbe92775da23707de715d5c6cba44034a0
---
 bfd/elfxx-riscv.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index fdcf9028ab..0a0711ef8d 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1244,9 +1244,7 @@ riscv_get_prefix_class (const char *arch)
 {
   switch (*arch)
     {
-    case 's':
-      return RV_ISA_CLASS_S;
-
+    case 's': return RV_ISA_CLASS_S;
     case 'x': return RV_ISA_CLASS_X;
     case 'z': return RV_ISA_CLASS_Z;
     default: return RV_ISA_CLASS_UNKNOWN;
@@ -1324,8 +1322,8 @@ riscv_parse_prefixed_ext (riscv_parse_subset_t *rps,
 
       /* Check that the name is valid.
 	 For 'x', anything goes but it cannot simply be 'x'.
-	 For 'z', it must be known from a list and also cannot simply be 'z'.
-	 For 's', it must be known from a list and also *can* simply be 's'.  */
+	 For 's', it must be known from a list and cannot simply be 's'.
+	 For 'z', it must be known from a list and cannot simply be 'z'.  */
 
       /* Check that the extension name is well-formed.  */
       if (!config->ext_valid_p (subset))
-- 
2.17.1



More information about the Binutils mailing list