machine types for MIPS in ELF file
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
Quoted 5 lines · Jun Sun
The
e_machinefield in ELF file standard defines two values for MIPS:8 - MIPS RS3000 BE
10 - MIPS RS4000 BE
Quoted 7 lines
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
Quoted 7 lines · Jun Sun
The
e_machinefield in ELF file standard defines two values for MIPS:8 - MIPS RS3000 BE
10 - MIPS RS4000 BENaturally 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.
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 11 lines · Ralf Baechle
Quoted 8 lines · Jun Sun
The
e_machinefield in ELF file standard defines two values for MIPS:8 - MIPS RS3000 BE
10 - MIPS RS4000 BENaturally the question is: what about LE binaries? And what about other CPUs? Is there any effort to clean up this thing?
Quoted 9 lines
Quoted 4 lines
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_BEwas apparently only in use for a short time;EM_MIPSis being used for both byte order. The byteorder is nowadays identified byEI_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
Quoted 6 lines · Jun Sun
The
e_machinefield in ELF file standard defines two values for MIPS:8 - MIPS RS3000 BE
10 - MIPS RS4000 BE
Quoted 8 lines
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
Signature · 4 lines
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
Quoted 1 line · Steven J. Hill
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...
Signature · 3 lines
+ Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [email protected], PGP key available +
Quoted 9 lines · Jun Sun
Quoted 4 lines
EM_MIPS_RS4_BEwas apparently only in use for a short time;EM_MIPSis being used for both byte order. The byteorder is nowadays identified byEI_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