This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH' RFA] fix mips disassembly new-abi detection.
- From: cgd at broadcom dot com
- To: binutils at sources dot redhat dot com
- Date: 11 Mar 2002 13:41:24 -0800
- Subject: [PATCH' RFA] fix mips disassembly new-abi detection.
Updated version of the patches from:
http://sources.redhat.com/ml/binutils/2002-03/msg00178.html
(1) dropped the default ABI selection change entirely.
(2) fixed the newabi detection code to accomodate Thiemo's comments in
the msg:
http://sources.redhat.com/ml/binutils/2002-03/msg00185.html
Passes binutils make && make check for targets mips-elf,
mipsisa32-elf, and mips64-elf with no new failures. (only failure
being for mipsisa32-elf, due to wrong selection of one of the ELF
tests by mips.exp.)
chris
===================================================================
[ opcodes/ChangeLog ]
2002-03-11 Chris Demetriou <cgd@broadcom.com>
* mips-dis.c (is_newabi): Fix ABI decoding.
Index: mips-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/mips-dis.c,v
retrieving revision 1.24
diff -u -p -r1.24 mips-dis.c
--- mips-dis.c 2001/11/05 03:07:51 1.24
+++ mips-dis.c 2002/03/11 21:35:18
@@ -397,10 +397,14 @@ static int
is_newabi (header)
Elf_Internal_Ehdr *header;
{
- if ((header->e_flags
- & (E_MIPS_ABI_EABI32 | E_MIPS_ABI_EABI64 | EF_MIPS_ABI2)) != 0
- || (header->e_ident[EI_CLASS] == ELFCLASS64
- && (header->e_flags & E_MIPS_ABI_O64) == 0))
+ /* There are no old-style ABIs which use 64-bit ELF. */
+ if (header->e_ident[EI_CLASS] == ELFCLASS64)
+ return 1;
+
+ /* If a 32-bit ELF file, N32, EABI32, and EABI64 are new-style ABIs. */
+ if ((header->e_flags & EF_MIPS_ABI2) != 0
+ || (header->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI32
+ || (header->e_flags & EF_MIPS_ABI) == E_MIPS_ABI_EABI64)
return 1;
return 0;