return 3;
case E_MIPS_ARCH_4:
return 4;
+ case E_MIPS_ARCH_5:
+ return 5;
+ case E_MIPS_ARCH_32:
+ return 32;
+ case E_MIPS_ARCH_64:
+ return 64;
}
return 4;
}
case E_MIPS_MACH_4650:
return bfd_mach_mips4650;
- case E_MIPS_MACH_MIPS32:
- return bfd_mach_mips4K;
+ case E_MIPS_MACH_MIPS32_4K:
+ return bfd_mach_mips32_4k;
+
+ case E_MIPS_MACH_SB1:
+ return bfd_mach_mips_sb1;
default:
switch (flags & EF_MIPS_ARCH)
case E_MIPS_ARCH_4:
return bfd_mach_mips8000;
break;
+
+ case E_MIPS_ARCH_5:
+ return bfd_mach_mips5;
+ break;
+
+ case E_MIPS_ARCH_32:
+ return bfd_mach_mips32;
+ break;
+
+ case E_MIPS_ARCH_64:
+ return bfd_mach_mips64;
+ break;
}
}
val = E_MIPS_ARCH_4;
break;
- case bfd_mach_mips4K:
- val = E_MIPS_ARCH_2 | E_MIPS_MACH_MIPS32;
+ case bfd_mach_mips32:
+ val = E_MIPS_ARCH_32;
+ break;
+
+ case bfd_mach_mips32_4k:
+ val = E_MIPS_ARCH_32 | E_MIPS_MACH_MIPS32_4K;
+ break;
+
+ case bfd_mach_mips5:
+ val = E_MIPS_ARCH_5;
+ break;
+
+ case bfd_mach_mips64:
+ val = E_MIPS_ARCH_64;
+ break;
+
+ case bfd_mach_mips_sb1:
+ val = E_MIPS_ARCH_64 | E_MIPS_MACH_SB1;
break;
}
flagword old_flags;
flagword new_flags;
boolean ok;
+ boolean null_input_bfd = true;
+ asection *sec;
/* Check if we have the same endianess */
if (_bfd_generic_verify_endian_match (ibfd, obfd) == false)
if (new_flags == old_flags)
return true;
+ /* Check to see if the input BFD actually contains any sections.
+ If not, its flags may not have been initialised either, but it cannot
+ actually cause any incompatibility. */
+ for (sec = ibfd->sections; sec != NULL; sec = sec->next)
+ {
+ /* Ignore synthetic sections and empty .text, .data and .bss sections
+ which are automatically generated by gas. */
+ if (strcmp (sec->name, ".reginfo")
+ && strcmp (sec->name, ".mdebug")
+ && ((!strcmp (sec->name, ".text")
+ || !strcmp (sec->name, ".data")
+ || !strcmp (sec->name, ".bss"))
+ && sec->_raw_size != 0))
+ {
+ null_input_bfd = false;
+ break;
+ }
+ }
+ if (null_input_bfd)
+ return true;
+
ok = true;
if ((new_flags & EF_MIPS_PIC) != (old_flags & EF_MIPS_PIC))
|| new_mach == old_mach
)
{
- /* Don't warn about mixing -mips1 and -mips2 code, or mixing -mips3
- and -mips4 code. They will normally use the same data sizes and
- calling conventions. */
+ /* Don't warn about mixing code using 32-bit ISAs, or mixing code
+ using 64-bit ISAs. They will normally use the same data sizes
+ and calling conventions. */
- if ((new_isa == 1 || new_isa == 2)
- ? (old_isa != 1 && old_isa != 2)
- : (old_isa == 1 || old_isa == 2))
+ if (( (new_isa == 1 || new_isa == 2 || new_isa == 32)
+ ^ (old_isa == 1 || old_isa == 2 || old_isa == 32)) != 0)
{
(*_bfd_error_handler)
(_("%s: ISA mismatch (-mips%d) with previous modules (-mips%d)"),
fprintf (file, _(" [mips3]"));
else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_4)
fprintf (file, _(" [mips4]"));
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_5)
+ fprintf (file, _ (" [mips5]"));
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_32)
+ fprintf (file, _ (" [mips32]"));
+ else if ((elf_elfheader (abfd)->e_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_64)
+ fprintf (file, _ (" [mips64]"));
else
fprintf (file, _(" [unknown ISA]"));