This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH RFA] small fix to MIPS abi selection/decoding.
- From: Thiemo Seufer <ica2_ts at csv dot ica dot uni-stuttgart dot de>
- To: binutils at sources dot redhat dot com
- Date: Sun, 10 Mar 2002 15:01:58 +0100
- Subject: Re: [PATCH RFA] small fix to MIPS abi selection/decoding.
- References: <yov5n0xhwlva.fsf@broadcom.com>
cgd@broadcom.com wrote:
[snip]
> Index: gas/config/tc-mips.c
> ===================================================================
> RCS file: /cvs/src/src/gas/config/tc-mips.c,v
> retrieving revision 1.112
> diff -u -p -r1.112 tc-mips.c
> --- tc-mips.c 2002/02/26 22:18:51 1.112
> +++ tc-mips.c 2002/03/09 19:55:02
> @@ -1098,9 +1098,9 @@ md_begin ()
> /* Default mips_abi. */
> if (mips_opts.abi == NO_ABI)
> {
> - if (mips_opts.isa == ISA_MIPS1 || mips_opts.isa == ISA_MIPS2)
> + if (! ISA_HAS_64BIT_REGS (mips_opts.isa))
> mips_opts.abi = O32_ABI;
> - else if (mips_opts.isa == ISA_MIPS3 || mips_opts.isa == ISA_MIPS4)
> + else
> mips_opts.abi = O64_ABI;
Please don't do this. As Daniel already explained, it's for gcc backward
compatibility where -mips2 was used meaning "create o32 objects for a
64bit capable processor". It shouldn't be expanded more than absolutely
needed.
> }
> }
> Index: opcodes/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/09 19:55:07
> @@ -397,10 +397,11 @@ 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
> + 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
> || (header->e_ident[EI_CLASS] == ELFCLASS64
> - && (header->e_flags & E_MIPS_ABI_O64) == 0))
> + && (header->e_flags & EF_MIPS_ABI) != E_MIPS_ABI_O64))
o64 is ELFCLASS32. AFAICS the test for ELFCLASS64 should be the first
(and unconditional). Otherwise it looks ok.
Thiemo