[PATCH] (Attempt to) Fix link compatibility check (was: Re: recent mips-elf linker "architecture ... incompatible" regressions)

Thiemo Seufer ica2_ts@csv.ica.uni-stuttgart.de
Tue Mar 19 08:23:00 GMT 2002


cgd@broadcom.com wrote:
> At Fri, 15 Mar 2002 14:51:48 +0000 (UTC), "Thiemo Seufer" wrote:
> > The patch below fixes at least some obvious cases. I'm not sure about
> > the r4xxx compatibility, especially WRT r4010 which is defined as
> > 64bit below but the disassembler calls it a MIPS II ISA. I also don't
> > know how mips16 should be handled, there are 32bit and 64bit CPU's
> > which implement the MIPS 16 extension.
> 
> * is it really desirable to be this picky linking together MIPS
> binaries?

The answer depends on binutils usage, I assume.

> * is this going to cause problems when trying to link together
> multiple which have been compiled specially (e.g. to use special
> instructions for 'incompatible' CPUs, where detection is done at
> run-time)?

Current behaviour is to prevent cross-linking if two files have
different CPU flags set. If one or both files have no CPU flags
set it allows linking ISA's with the same maximum wordsize. That's
at least inconsistent.

[snip]
> Personally, I'd answer the first question as "no, it's not," and fall
> back on simple tests based on, say, object file relocation size
> compatibility, ABI stuff, etc.

Then mips_compatible shouldn't make any attempt beyond comparing the
bfd arch. AFAICS your comment also means we shouldn't have any CPU
header flags.


Thiemo



More information about the Binutils mailing list