This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
PATCH: Fix the MIPS elf header
- From: "H . J . Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Fri, 1 Feb 2002 11:07:25 -0800
- Subject: PATCH: Fix the MIPS elf header
Here is the patch to fix the MIPS elf header. Any comments?
H.J.
----
2002-02-01 H.J. Lu (hjl@gnu.org)
* elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data): Update
the mach and ISA fields if necessary.
--- bfd/elf32-mips.c.hdr Fri Feb 1 10:43:43 2002
+++ bfd/elf32-mips.c Fri Feb 1 10:59:40 2002
@@ -3236,8 +3236,21 @@ _bfd_mips_elf_merge_private_bfd_data (ib
bfd_archive_filename (ibfd), new_isa, old_isa);
ok = false;
}
- }
+ else
+ {
+ /* Do we need to update the mach field? */
+ if (old_mach == 0 && new_mach != 0)
+ elf_elfheader (obfd)->e_flags |= new_mach;
+ /* Do we need to update the ISA field? */
+ if (new_isa > old_isa)
+ {
+ elf_elfheader (obfd)->e_flags &= ~EF_MIPS_ARCH;
+ elf_elfheader (obfd)->e_flags
+ |= new_flags & EF_MIPS_ARCH;
+ }
+ }
+ }
else
{
(*_bfd_error_handler)