aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfnn-riscv.c
diff options
context:
space:
mode:
authorNelson Chu <nelson.chu@sifive.com>2021-04-13 12:32:16 +0800
committerNelson Chu <nelson.chu@sifive.com>2021-04-13 12:49:51 +0800
commite3839c100fdb15d05e6a2fd44557ffdd6fb921b8 (patch)
tree12276e778432ad0ca3459ec5bc2fe3a59d385113 /bfd/elfnn-riscv.c
parent8d85d1f53f28f5ec020add7326055f73dce6ced0 (diff)
downloadgdb-e3839c100fdb15d05e6a2fd44557ffdd6fb921b8.zip
gdb-e3839c100fdb15d05e6a2fd44557ffdd6fb921b8.tar.gz
gdb-e3839c100fdb15d05e6a2fd44557ffdd6fb921b8.tar.bz2
RISC-V: Don't report the mismatched version warning for the implicit extensions.
bfd/ * elfnn-riscv.c (riscv_version_mismatch): Do not report the warning when the version of input or output is RISCV_UNKNOWN_VERSION, since the extension is added implicitly. * elfxx-riscv.c: Updated the obsolete comments. (RISCV_UNKNOWN_VERSION): Moved to elfxx-riscv.h. * elfxx-riscv.h (RISCV_UNKNOWN_VERSION): Added.
Diffstat (limited to 'bfd/elfnn-riscv.c')
-rw-r--r--bfd/elfnn-riscv.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 07089ef7..5e29278 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -3332,15 +3332,25 @@ riscv_version_mismatch (bfd *ibfd,
if (in->major_version != out->major_version
|| in->minor_version != out->minor_version)
{
- _bfd_error_handler
- (_("warning: %pB: mis-matched ISA version %d.%d for '%s' "
- "extension, the output version is %d.%d"),
- ibfd,
- in->major_version,
- in->minor_version,
- in->name,
- out->major_version,
- out->minor_version);
+ if ((in->major_version == RISCV_UNKNOWN_VERSION
+ && in->minor_version == RISCV_UNKNOWN_VERSION)
+ || (out->major_version == RISCV_UNKNOWN_VERSION
+ && out->minor_version == RISCV_UNKNOWN_VERSION))
+ {
+ /* Do not report the warning when the version of input
+ or output is RISCV_UNKNOWN_VERSION, since the extension
+ is added implicitly. */
+ }
+ else
+ _bfd_error_handler
+ (_("warning: %pB: mis-matched ISA version %d.%d for '%s' "
+ "extension, the output version is %d.%d"),
+ ibfd,
+ in->major_version,
+ in->minor_version,
+ in->name,
+ out->major_version,
+ out->minor_version);
/* Update the output ISA versions to the newest ones. */
if ((in->major_version > out->major_version)