[PATCH] RISC-V: Check the Zca extension when disabling the C extension using .option norvc.

Ethan Yu-Cheng Liang(梁淯程) ycl669@andestech.com
Fri Oct 4 07:11:58 GMT 2024


.option norvc disables only the C extension, not all 16-bit instructions.

Signed-off-by: Ethan Yu-Cheng Liang <ycl669@andestech.com>
---
 gas/config/tc-riscv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c
index ef455e449b9..4ef7b8e689e 100644
--- a/gas/config/tc-riscv.c
+++ b/gas/config/tc-riscv.c
@@ -4917,7 +4917,7 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
     {
       riscv_update_subset (&riscv_rps_as, "-c");
       riscv_set_arch_str (&riscv_rps_as.subset_list->arch_str);
-      riscv_set_rvc (false);
+      riscv_set_rvc (riscv_subset_supports (&riscv_rps_as, "zca"));
     }
   else if (strcmp (name, "pic") == 0)
     riscv_opts.pic = true;
--
2.45.2

CONFIDENTIALITY NOTICE:

This e-mail (and its attachments) may contain confidential and legally privileged information or information protected from disclosure. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein is strictly prohibited. In this case, please immediately notify the sender by return e-mail, delete the message (and any accompanying documents) and destroy all printed hard copies. Thank you for your cooperation.

Copyright ANDES TECHNOLOGY CORPORATION - All Rights Reserved.


More information about the Binutils mailing list