Subject: machine types for MIPS in ELF file

From: Jun Sun <[email-masked]>
Date: Tue, 08 May 2001 12:07:35 -0700

The e_machine field in ELF file standard defines two values for MIPS:

8	- MIPS RS3000 BE
10	- MIPS RS4000 BE

Naturally the question is: what about LE binaries?  And what about other
CPUs?  Is there any effort to clean up this thing?

All the tools that I know of are using 8, pretty much for all CPUs and both
endians.  No real harm has been observed, but it causes some anonying "invalid
byte order" complains if you do "file" on a MIPS LE binary.  Of course, it
will also invariably reports "R3000" cpu as well.

Jun

---

From: Ralf Baechle <[email-masked]>
Date: Tue, 8 May 2001 16:48:46 -0300

> will also invariably reports "R3000" cpu as well.

EM_MIPS_RS4_BE was apparently only in use for a short time; EM_MIPS is
being used for both byte order.  The byteorder is nowadays identified by
EI_DATA.

  Ralf

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Tue, 8 May 2001 21:34:22 +0200 (MET DST)

> CPUs?  Is there any effort to clean up this thing?

 The latter has been changed to "MIPS RS3000 LE" in the latest ELF spec,
AFAIK.  The ISA level is further specified in the e_flags field.  No idea
why they want to keep redundant endianness information in e_machine --
there is an endianness specification at e_ident[5]. 

 Also no idea why they named the CPU RS3000 and not R3000. 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: [email-masked], PGP key available        +

---

From: Jun Sun <[email-masked]>
Date: Tue, 08 May 2001 14:20:06 -0700

> being used for both byte order.  The byteorder is nowadays identified by

That makes a lot of sense.

BTW, where is the latest ELF spec that says so?  Maciej, which spec are you
referring to?

Jun

---

From: "Steven J. Hill" <[email-masked]>
Date: Wed, 09 May 2001 07:04:48 -0500

> will also invariably reports "R3000" cpu as well.
This has bothered me as well. I would like to see a few machines added
at least something like R5000, R8000, R10000 along with the proper ISA
value being stored in the e_flags field. I would be more than happy to
help make the changes as it is something that IMHO needs to be fixed.

As far as the latest ABI specs go, here are 2 different links for the
same documents. Ralf and I went digging for these a few weeks back.

    http://www.sco.com/partners/developer/devspecs/
    http://www.linuxbase.org/spec/refspecs/

-Steve

-- 
 Steven J. Hill - Embedded SW Engineer
 Public Key: 'http://www.cotw.com/pubkey.txt'
 FPR1: E124 6E1C AF8E 7802 A815
 FPR2: 7D72 829C 3386 4C4A E17D

---

From: "Maciej W. Rozycki" <[email-masked]>
Date: Wed, 9 May 2001 15:54:33 +0200 (MET DST)

>     http://www.sco.com/partners/developer/devspecs/

 Thanks for the reference -- I've been able to locate new draft versions
up to Apr 24, 2001 at 'http://www.sco.com/developer/gabi/'.  I wonder why
I haven't noticed them before...

---

From: Ralf Baechle <[email-masked]>
Date: Wed, 9 May 2001 23:08:47 -0300

> BTW, where is the latest ELF spec that says so?  Maciej, which spec are you

I checked with the keepers of the ABI - EM_MIPS_RS4_BE was never registered
and EM_MIPS_RS3_LE was already registered in '92.  Anyway, my statement
stays.  I've never seen object files using architecture number 10 nor
EM_MIPS_RS3_LE used in any source except the constant definitions.

  Ralf