diff options
author | Nelson Chu <nelson@rivosinc.com> | 2022-11-01 21:51:55 +0800 |
---|---|---|
committer | Nelson Chu <nelson@rivosinc.com> | 2022-11-02 13:00:27 +0800 |
commit | d918451a044821abd285f7a5bc5547ec9b50a118 (patch) | |
tree | 97e48870f8708a9d00a4848e3686ef328e9c5c03 /etc | |
parent | 2188d6ea4f8300a688dc73c7a71881439d3ea49b (diff) | |
download | gdb-d918451a044821abd285f7a5bc5547ec9b50a118.zip gdb-d918451a044821abd285f7a5bc5547ec9b50a118.tar.gz gdb-d918451a044821abd285f7a5bc5547ec9b50a118.tar.bz2 |
RISC-V: Fixed the missing $x+arch when adding odd paddings for alignment.
Consider the case,
.option arch, rv32i
.option norelax
.option arch, +c
.byte 1
.align 2
addi a0, zero, 1
Assembler adds $d for the odd .byte, and then adds $x+arch for the
alignment. Since norelax, riscv_add_odd_padding_symbol will add the
$d and $x for the odd alignment, but accidently remove the $x+arch because
it has the same address as $d. Therefore, we will get the unexpected result
before applying this patch,
.byte 1 # $d
.align 2 # odd alignment, $xrv32ic replaced by $d + $x
After this patch, the expected result should be,
.byte 1 # $d
.align 2 # odd alignment, $xrv32ic replaced by $d + $xrv32ic
gas/
* config/tc-riscv.c (make_mapping_symbol): If we are adding mapping symbol
for odd alignment, then we probably will remove the $x+arch by accidently
when it has the same address of $d. Try to add the removed $x+arch back
after the $d rather than just $x.
(riscv_mapping_state): Updated since parameters of make_mapping_symbol are
changed.
(riscv_add_odd_padding_symbol): Likewise.
(riscv_remove_mapping_symbol): Removed and moved the code into the
riscv_check_mapping_symbols.
(riscv_check_mapping_symbols): Updated.
* testsuite/gas/riscv/mapping-dis.d: Updated and added new testcase.
* testsuite/gas/riscv/mapping-symbols.d: Likewise.
* testsuite/gas/riscv/mapping.s: Likewise.
Diffstat (limited to 'etc')
0 files changed, 0 insertions, 0 deletions