[PATCH 1/1] RISC-V: Fix wrong version number when arch contains 'p'.

Cooper Qu cooper.qu@linux.alibaba.com
Wed Sep 22 08:14:36 GMT 2021


When specify a default version for p extension in
riscv_supported_std_ext[](elfxx-riscv.c) and assembling with
-march=rv32imacp, the c extension's version in attribute will become
0p0, the expectation is 2p0.

bfd/
	PR gas/28372
	* elfxx-riscv.c (riscv_parsing_subset_version): Break if p
	represent the 'p' extension.

Change-Id: Ia4e0cf26f3d7d07acaee8cefd86707ecac663a59
---
 bfd/elfxx-riscv.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c
index b467bce..8b3fa4f 100644
--- a/bfd/elfxx-riscv.c
+++ b/bfd/elfxx-riscv.c
@@ -1546,11 +1546,7 @@ riscv_parsing_subset_version (riscv_parse_subset_t *rps,
 	    {
 	      /* Might be beginning of `p` extension.  */
 	      if (std_ext_p)
-		{
-		  *major_version = version;
-		  *minor_version = 0;
-		  return p;
-		}
+		break;
 	      else
 		{
 		  rps->error_handler
-- 
2.7.4



More information about the Binutils mailing list