RISC-V: Stop reporting warnings for mismatched extension versions
authorPalmer Dabbelt <palmer@rivosinc.com>
Mon, 7 Feb 2022 20:14:30 +0000 (12:14 -0800)
committerPalmer Dabbelt <palmer@rivosinc.com>
Tue, 8 Feb 2022 16:23:28 +0000 (08:23 -0800)
commit87fdd7ac09b1c3cfd7443a3ffc5abb9bb178bc6e
treec03e2f879052249179318dde222bb0a6bdaf40ed
parent481153777e278b71e694fd2db6b897f7a9e3dcb8
RISC-V: Stop reporting warnings for mismatched extension versions

The extension version checking logic is really just too complicated to
encode into the linker, trying to do so causes more harm than good.
This removes the checks and the associated tests, leaving the logic to
keep the largest version of each extension linked into the target.

bfd/

* elfnn-riscv.c (riscv_version_mismatch): Rename to
riscv_update_subset_version, and stop reporting warnings on
version mismatches.
(riscv_merge_std_ext): Adjust calls to riscv_version_mismatch.
(riscv_merge_multi_letter_ext): Likewise.

ld/
* testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d: Remove
* testsuite/ld-riscv-elf/attr-merge-arch-failed-01a.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-01b.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02a.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02b.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02c.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02d.s: Likewise
* testsuite/ld-riscv-elf/attr-merge-user-ext-01.d: New test.
* testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i21_m2p0.s:
Likewise.
* testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i21_m2p1.s:
Likewise.
* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Remove obselete
attr-merge-arch-failed-{01,02}, replace with
attr-merge-user-ext-01.

Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
13 files changed:
bfd/elfnn-riscv.c
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d [deleted file]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-01a.s [deleted file]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-01b.s [deleted file]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d [deleted file]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-02a.s [deleted file]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-02b.s [deleted file]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-02c.s [deleted file]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-02d.s [deleted file]
ld/testsuite/ld-riscv-elf/attr-merge-user-ext-01.d [new file with mode: 0644]
ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_m2p0.s [new file with mode: 0644]
ld/testsuite/ld-riscv-elf/attr-merge-user-ext-rv32i2p1_m2p1.s [new file with mode: 0644]
ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp