summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/bfd/elf32-mips.c
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/binutils/bfd/elf32-mips.c')
-rw-r--r--gnu/usr.bin/binutils/bfd/elf32-mips.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gnu/usr.bin/binutils/bfd/elf32-mips.c b/gnu/usr.bin/binutils/bfd/elf32-mips.c
index 1bc95b8d06f..d018c6901c8 100644
--- a/gnu/usr.bin/binutils/bfd/elf32-mips.c
+++ b/gnu/usr.bin/binutils/bfd/elf32-mips.c
@@ -1730,12 +1730,23 @@ _bfd_mips_elf_merge_private_bfd_data (ibfd, obfd)
}
/* Warn about any other mismatches */
- if (new_flags != old_flags)
+ if ((new_flags & ~(EF_MIPS_ARCH | EF_MIPS_NOREORDER)) !=
+ (old_flags & ~(EF_MIPS_ARCH | EF_MIPS_NOREORDER)))
(*_bfd_error_handler)
("%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)",
bfd_get_filename (ibfd), (unsigned long) new_flags,
(unsigned long) old_flags);
+ /* Warn about ISA LEVEL mismatch */
+ if ((new_flags & EF_MIPS_ARCH) > (old_flags & EF_MIPS_ARCH)) {
+ (*_bfd_error_handler)
+ ("%s: increases ISA level to ISA%d from ISA%d",
+ bfd_get_filename (ibfd), (unsigned long) new_flags >> 28,
+ (unsigned long) old_flags >> 28);
+ elf_elfheader (obfd)->e_flags &= ~EF_MIPS_ARCH;
+ elf_elfheader (obfd)->e_flags |= new_flags & EF_MIPS_ARCH;
+ }
+
bfd_set_error (bfd_error_bad_value);
return false;
}