All of lore.kernel.org
 help / color / mirror / Atom feed
* machine types for MIPS in ELF file
@ 2001-05-08 19:07 Jun Sun
  2001-05-08 19:34 ` Maciej W. Rozycki
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jun Sun @ 2001-05-08 19:07 UTC (permalink / raw)
  To: linux-mips


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: machine types for MIPS in ELF file
  2001-05-08 19:07 machine types for MIPS in ELF file Jun Sun
@ 2001-05-08 19:34 ` Maciej W. Rozycki
  2001-05-08 19:48 ` Ralf Baechle
  2001-05-09 12:04 ` Steven J. Hill
  2 siblings, 0 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2001-05-08 19:34 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips

On Tue, 8 May 2001, Jun Sun wrote:

> 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?

 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: macro@ds2.pg.gda.pl, PGP key available        +

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: machine types for MIPS in ELF file
  2001-05-08 19:07 machine types for MIPS in ELF file Jun Sun
  2001-05-08 19:34 ` Maciej W. Rozycki
@ 2001-05-08 19:48 ` Ralf Baechle
  2001-05-08 21:20   ` Jun Sun
  2001-05-09 12:04 ` Steven J. Hill
  2 siblings, 1 reply; 7+ messages in thread
From: Ralf Baechle @ 2001-05-08 19:48 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips

On Tue, May 08, 2001 at 12:07:35PM -0700, Jun Sun wrote:

> 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.

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: machine types for MIPS in ELF file
  2001-05-08 19:48 ` Ralf Baechle
@ 2001-05-08 21:20   ` Jun Sun
  2001-05-10  2:08     ` Ralf Baechle
  0 siblings, 1 reply; 7+ messages in thread
From: Jun Sun @ 2001-05-08 21:20 UTC (permalink / raw)
  To: Ralf Baechle, macro; +Cc: linux-mips

Ralf Baechle wrote:
> 
> On Tue, May 08, 2001 at 12:07:35PM -0700, Jun Sun wrote:
> 
> > 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.
> 
> 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.
> 

That makes a lot of sense.

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

Jun

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: machine types for MIPS in ELF file
  2001-05-08 19:07 machine types for MIPS in ELF file Jun Sun
  2001-05-08 19:34 ` Maciej W. Rozycki
  2001-05-08 19:48 ` Ralf Baechle
@ 2001-05-09 12:04 ` Steven J. Hill
  2001-05-09 13:54   ` Maciej W. Rozycki
  2 siblings, 1 reply; 7+ messages in thread
From: Steven J. Hill @ 2001-05-09 12:04 UTC (permalink / raw)
  To: Jun Sun; +Cc: linux-mips

Jun Sun wrote:
> 
> 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.
> 
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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: machine types for MIPS in ELF file
  2001-05-09 12:04 ` Steven J. Hill
@ 2001-05-09 13:54   ` Maciej W. Rozycki
  0 siblings, 0 replies; 7+ messages in thread
From: Maciej W. Rozycki @ 2001-05-09 13:54 UTC (permalink / raw)
  To: Steven J. Hill; +Cc: Jun Sun, linux-mips

On Wed, 9 May 2001, Steven J. Hill wrote:

>     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... 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: machine types for MIPS in ELF file
  2001-05-08 21:20   ` Jun Sun
@ 2001-05-10  2:08     ` Ralf Baechle
  0 siblings, 0 replies; 7+ messages in thread
From: Ralf Baechle @ 2001-05-10  2:08 UTC (permalink / raw)
  To: Jun Sun; +Cc: macro, linux-mips

On Tue, May 08, 2001 at 02:20:06PM -0700, Jun Sun wrote:

> > 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.
> > 
> 
> That makes a lot of sense.
> 
> BTW, where is the latest ELF spec that says so?  Maciej, which spec are you
> referring to?

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2001-05-10  2:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-08 19:07 machine types for MIPS in ELF file Jun Sun
2001-05-08 19:34 ` Maciej W. Rozycki
2001-05-08 19:48 ` Ralf Baechle
2001-05-08 21:20   ` Jun Sun
2001-05-10  2:08     ` Ralf Baechle
2001-05-09 12:04 ` Steven J. Hill
2001-05-09 13:54   ` Maciej W. Rozycki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.