]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bpf: Fixed register parsing disambiguating with possible symbol.
authorCupertino Miranda <cupertino.miranda@oracle.com>
Tue, 21 Nov 2023 12:26:08 +0000 (12:26 +0000)
committerCupertino Miranda <cupertino.miranda@oracle.com>
Tue, 21 Nov 2023 18:33:54 +0000 (18:33 +0000)
This changes parse_bpf_register to detect possible symbols that start with valid
register name, however due some following characters are not.
Also changed the regs-for-symbols-pseudo.s, adding some entries that
should not error if parser is properly detecting the symbol.

gas/config/tc-bpf.c
gas/testsuite/gas/bpf/regs-for-symbols-pseudoc.s

index 45abc3c95782217246f5a9bf6fb0ccb563c7f6da..b6b1db4742719b15bd525bef8af7159a3b58cd60 100644 (file)
@@ -1300,6 +1300,10 @@ parse_bpf_register (char *s, char rw, uint8_t *regno)
       s += 1;
     }
 
+  /* If we are still parsing a name, it is not a register.  */
+  if (is_part_of_name (*s))
+    return NULL;
+
   return s;
 }
 
index 693787d5479f0c38104203efb23505772a1a1495..9b75f275285836235b6c503b36a6326929793feb 100644 (file)
@@ -2,3 +2,6 @@
         r2 = r3 ll
         r2 = r3+1 ll
         r2 = 1+r3 ll
+        r2 = r2d2 ll
+        r2 = r2d2+1 ll
+        r2 = 1+r2d2 ll