]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: bpf: do not allow referring to register names as symbols in operands
authorJose E. Marchesi <jose.marchesi@oracle.com>
Sat, 18 Nov 2023 17:12:44 +0000 (18:12 +0100)
committerJose E. Marchesi <jose.marchesi@oracle.com>
Sat, 18 Nov 2023 17:17:26 +0000 (18:17 +0100)
commit8fbb497b7202f404d8914252d44d2ee190a0e172
treef66854caee10fdcb22186c67eedae3aebe24f1f5
parent26c7a0ea380bedb86ff3b5a9ed252d8d2557a0c5
gas: bpf: do not allow referring to register names as symbols in operands

2023-11-18  Jose E. Marchesi  <jemarch@gnu.org>

* config/tc-bpf.c (parse_bpf_register): Move before
bpf_parse_name.
(bpf_parse_name): Do not allow using symbols that are also
register names as operands in pseudo-c syntax.
* testsuite/gas/bpf/regs-for-symbols-pseudoc.d: New file.
* testsuite/gas/bpf/regs-for-symbols-pseudoc.s: Likewise.
* testsuite/gas/bpf/regs-for-symbols-pseudoc.l: Likewise.
* doc/c-bpf.texi (BPF Registers): Document that it is not possible
to refer to register names as symbols in instruction operands.
gas/ChangeLog
gas/config/tc-bpf.c
gas/doc/c-bpf.texi
gas/testsuite/gas/bpf/bpf.exp
gas/testsuite/gas/bpf/regs-for-symbols-pseudoc.d [new file with mode: 0644]
gas/testsuite/gas/bpf/regs-for-symbols-pseudoc.l [new file with mode: 0644]
gas/testsuite/gas/bpf/regs-for-symbols-pseudoc.s [new file with mode: 0644]