]> git.feebdaed.xyz Git - 0xmirror/binutils-gdb.git/commitdiff
gas/CFI: fix .cfi_escape parsing when equates are in use
authorJan Beulich <jbeulich@suse.com>
Mon, 22 Dec 2025 10:06:13 +0000 (11:06 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 22 Dec 2025 10:06:13 +0000 (11:06 +0100)
The restoring of the line pointer needs to happen in more cases.

While there also adjust a slightly misleading comment.

Reviewed-by: Jens Remus <jremus@linux.ibm.com>
gas/dw2gencfi.c
gas/testsuite/gas/cfi/listing.l
gas/testsuite/gas/cfi/listing.s

index 44124807416e2841c4a03a7e59812ebac2d8f0df..5b1cdfba6af489d66d1bd7e04aefd60d6c59d53b 100644 (file)
@@ -996,11 +996,10 @@ dot_cfi_escape (int ignored ATTRIBUTE_UNUSED)
          if (is_whitespace (c))
            c = *++input_line_pointer;
          if (c != '(')
-           {
-             input_line_pointer = ilp_save;
-             e->type = CFI_ESC_byte;
-           }
+           e->type = CFI_ESC_byte;
        }
+      if (e->type == CFI_ESC_byte)
+       input_line_pointer = ilp_save;
 
       if (e->type == CFI_ESC_sleb128 || e->type == CFI_ESC_uleb128)
        {
@@ -1010,7 +1009,7 @@ dot_cfi_escape (int ignored ATTRIBUTE_UNUSED)
        }
       else
        {
-         /* We may still be at the opening parenthesis.  Leave it to expression()
+         /* We may still be at an opening parenthesis.  Leave it to expression()
             to parse it and find the matching closing one.  */
          e->reloc = do_parse_cons_expression (&e->exp, e->type);
        }
index 3290fb664a240d5c3068b604b20dc5003223677f..b3645e91e2da99782bd05b3e2745217fa0314403 100644 (file)
@@ -24,7 +24,8 @@
 [      ]*[0-9]*[       ]+(4[048]00 ?0000|0000 ?004[048]) *
 [      ]*[0-9]*[       ]+[0-9a-f]{4} .*[       ]\.nop
 [      ]*[0-9]*[       ]+/\* DW_CFA_register reg127, reg129.  \*/
-[      ]*[0-9]*[       ]+[0-9a-f]{4} 4.09 ?7F81[       ]+\.cfi_escape 0x09, uleb128\(127\), uleb128\(129\)
+[      ]*[0-9]*[       ]+\.equiv DW_CFA_register, 0x09
+[      ]*[0-9]*[       ]+[0-9a-f]{4} 4.09 ?7F81[       ]+\.cfi_escape DW_CFA_register, uleb128\(127\), uleb128\(129\)
 [      ]*[0-9]*[       ]+01
 [      ]*[0-9]*[       ]+/\* DW_CFA_val_expression reg250, ...  \*/
 [      ]*[0-9]*[       ]+[0-9a-f]{4} 16FA ?01[         ]+\.cfi_escape 0x16, uleb128\(250\)
index 6794f8a5db1cfe0a98eae283cc3c144cd78ce7e6..d54d648355e3b17f1d7e85010dfbd59b18095ddb 100644 (file)
@@ -20,7 +20,8 @@ func2:
        .cfi_startproc
        .nop
        /* DW_CFA_register reg127, reg129.  */
-       .cfi_escape 0x09, uleb128(127), uleb128(129)
+       .equiv DW_CFA_register, 0x09
+       .cfi_escape DW_CFA_register, uleb128(127), uleb128(129)
        /* DW_CFA_val_expression reg250, ...  */
        .cfi_escape 0x16, uleb128(250)
        /* ... <len>.  */