> I was reading ELF headers from different arches when I found that for > Loongson binaries em_machine==EM_MIPS. However, elf(5) and > elf_abi.h->sys/exec_elf.h describe EM_MIPS as "/* MIPS R3000 > Big-Endian only */", whereas I think Loongson processors are little > endian(objdump says elf64-littlemips). > > So, do these descriptions need to be changed or is it something else?
Yes and no. This value was initially registered by Mips as R3000 BE, but as the various operating systems availble on mips-compatible cpus switched from ECOFF to ELF, they have reused this value even if the processor model or endianness was different. This doesn't mattter much since endianness and 32 vs 64 bit information is found in the e_ident field of the ELF header. Miod

