RISC-V: Report warnings rather than errors for the mis-matched ISA versions.
authorNelson Chu <nelson.chu@sifive.com>
Tue, 18 Aug 2020 09:48:34 +0000 (17:48 +0800)
committerNelson Chu <nelson.chu@sifive.com>
Thu, 3 Sep 2020 03:11:51 +0000 (11:11 +0800)
commit32f0ce4db98eb1e8e1cc326d3a22ef0c436ae6fe
treed20388d7924e00b1f98f0ddf41711e4c927768eb
parent72bd6912ea38224481f8bd0ed13b751e0fda4683
RISC-V: Report warnings rather than errors for the mis-matched ISA versions.

Same as the privileged spec attributes check - different ISA versions
should be compatible, unless there are some known conflicts.  Therefore,
we should allow to link objects with different ISA versions, and update
the output ISA versions once the corresponding input ones are newer.
But it's better to also warn people that the conflicts may happen when
the ISA versions are mis-matched.

bfd/
* elfnn-riscv.c (riscv_version_mismatch): Change the return type
from void to bfd_boolean.  Report warnings rather than errors
when the ISA versions are mis-matched.  Afterwards, remember to
update the output ISA versions to the newest ones.
(riscv_merge_std_ext): Allow to link objects with different
standard ISA versions.  Try to add output ISA versions to
merged_subsets first.
(riscv_merge_multi_letter_ext): Likewise.  But for standard additional
ISA and non-standard ISA versions.

ld/
* testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d: Update the
message from error to warning.
* testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d: New testcases.
* 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/ld-riscv-elf.exp: Updated.
bfd/ChangeLog
bfd/elfnn-riscv.c
ld/ChangeLog
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-01.d
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-02.d [new file with mode: 0644]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-02a.s [new file with mode: 0644]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-02b.s [new file with mode: 0644]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-02c.s [new file with mode: 0644]
ld/testsuite/ld-riscv-elf/attr-merge-arch-failed-02d.s [new file with mode: 0644]
ld/testsuite/ld-riscv-elf/ld-riscv-elf.exp