]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
RISC-V: Fixed that .option push/pop won't recover the xlen
authorNelson Chu <nelson@rivosinc.com>
Fri, 4 Jul 2025 05:42:37 +0000 (13:42 +0800)
committerNelson Chu <nelson@rivosinc.com>
Tue, 8 Jul 2025 09:15:45 +0000 (17:15 +0800)
gas/config/tc-riscv.c
gas/testsuite/gas/riscv/option-norvc.d

index d0030de46817c7947273316436e5c0b0f753a88b..60e4f5bf813a25f672bd7213db7b73cc10059ffc 100644 (file)
@@ -332,6 +332,7 @@ struct riscv_option_stack
   struct riscv_option_stack *next;
   struct riscv_set_options options;
   riscv_subset_list_t *subset_list;
+  unsigned xlen;
 };
 
 static struct riscv_option_stack *riscv_opts_stack = NULL;
@@ -5113,6 +5114,7 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
       s->next = riscv_opts_stack;
       s->options = riscv_opts;
       s->subset_list = riscv_rps_as.subset_list;
+      s->xlen = xlen;
       riscv_opts_stack = s;
       riscv_rps_as.subset_list = riscv_copy_subset_list (s->subset_list);
     }
@@ -5129,6 +5131,7 @@ s_riscv_option (int x ATTRIBUTE_UNUSED)
          riscv_opts_stack = s->next;
          riscv_opts = s->options;
          riscv_rps_as.subset_list = s->subset_list;
+         xlen = s->xlen;
          riscv_release_subset_list (release_subsets);
          free (s);
        }
index 13b0705fa8fe3e9f434c5ce27ae81357bf633413..107e3f98275f7f008389022dacfb4713d5cfe29e 100644 (file)
@@ -12,11 +12,11 @@ SYMBOL TABLE:
 0+02 l       .text     0+00 \$xrv64i2p0
 0+06 l       .text     0+00 \$xrv32i2p0_f2p0_c2p0
 0+08 l       .text     0+00 \$xrv32i2p0_f2p0
-0+0c l       .text     0+00 \$xrv32i2p0_f2p0_d2p0_c2p0
-0+0e l       .text     0+00 \$xrv32i2p0_f2p0_d2p0
-0+12 l       .text     0+00 \$xrv32i2p0_f2p0_d2p0_zca1p0
+0+0c l       .text     0+00 \$xrv64i2p0_f2p0_d2p0_c2p0
+0+0e l       .text     0+00 \$xrv64i2p0_f2p0_d2p0
+0+12 l       .text     0+00 \$xrv64i2p0_f2p0_d2p0_zca1p0
 0+18 l       .text     0+00 \$xrv32i2p0_f2p0_zca1p0_zcf1p0
-0+1e l       .text     0+00 \$xrv32i2p0_f2p0_d2p0_zca1p0_zcd1p0
+0+1e l       .text     0+00 \$xrv64i2p0_f2p0_d2p0_zca1p0_zcd1p0
 0+24 l       .text     0+00 \$xrv32i2p0_zilsd1p0_zca1p0_zcb1p0_zclsd1p0
 0+30 l       .text     0+00 \$xrv64i2p0_zca1p0_zcmop1p0_zcmp1p0_zcmt1p0
 0+0 l    d  .riscv.attributes  0+00 .riscv.attributes