diff options
author | Jan Beulich <jbeulich@suse.com> | 2023-05-04 10:24:36 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2023-05-04 10:24:36 +0200 |
commit | 654dfab0666513a4e9c053559d0c184b863139c4 (patch) | |
tree | 0262142cab74aebe520e97bea2f50b4f4bda250f /gas/config | |
parent | c9819077700c5fc440981c3b14e21225f4c14d01 (diff) | |
download | gdb-654dfab0666513a4e9c053559d0c184b863139c4.zip gdb-654dfab0666513a4e9c053559d0c184b863139c4.tar.gz gdb-654dfab0666513a4e9c053559d0c184b863139c4.tar.bz2 |
RISC-V: tighten post-relocation-operator separator expectation
As per the spec merely a blank isn't okay as a separator, the operand
to the relocation function ought to be parenthesized. Enforcing this
then also eliminates an inconsistency in that
lui t0, %hi sym
lui t0, %hi 0x1000
were accepted, but
lui t0, %hi +sym
lui t0, %hi -0x1000
were not.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-riscv.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index a94d4f6..0cc2484 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -2200,7 +2200,9 @@ parse_relocation (char **str, bfd_reloc_code_real_type *reloc, { size_t len = 1 + strlen (percent_op->str); - if (!ISSPACE ((*str)[len]) && (*str)[len] != '(') + while (ISSPACE ((*str)[len])) + ++len; + if ((*str)[len] != '(') continue; *str += len; |