@@ -628,6 +628,7 @@ static const char * const g_Machines[] =
628628static const CUInt32PCharPair g_MachinePairs[] =
629629{
630630 { 243 , " RISC-V" },
631+ { 258 , " LoongArch" },
631632 { 0x9026 , " Alpha" }, // EM_ALPHA_EXP, obsolete, (used by NetBSD/alpha) (written in the absence of an ABI)
632633 { 0xbaab , " Xilinx MicroBlaze" }
633634};
@@ -853,18 +854,16 @@ Z7_COM7F_IMF(CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value))
853854 else if (_header.Machine == k_Machine_MIPS)
854855 {
855856 const UInt32 ver = flags >> 28 ;
856- s += " v " ;
857+ s. Add_Char ( ' v ' ) ;
857858 s.Add_UInt32 (ver);
858859 flags &= ((UInt32)1 << 28 ) - 1 ;
859-
860860 const UInt32 abi = (flags >> 12 ) & 7 ;
861861 if (abi)
862862 {
863863 s += " ABI:" ;
864864 s.Add_UInt32 (abi);
865865 }
866866 flags &= ~((UInt32)7 << 12 );
867-
868867 s.Add_Space ();
869868 s += FlagsToString (g_MIPS_Flags, Z7_ARRAY_SIZE (g_MIPS_Flags), flags);
870869 }
@@ -885,6 +884,31 @@ Z7_COM7F_IMF(CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value))
885884 flags &= ~(UInt32)6 ;
886885 s += FlagsToString (g_RISCV_Flags, Z7_ARRAY_SIZE (g_RISCV_Flags), flags);
887886 }
887+ #if 0
888+ #define k_Machine_LOONGARCH 258
889+ else if (_header.Machine == k_Machine_LOONGARCH)
890+ {
891+ s += "ABI:";
892+ s.Add_UInt32((flags >> 6) & 3);
893+ s.Add_Dot();
894+ s.Add_UInt32((flags >> 3) & 7);
895+ s.Add_Dot();
896+ #if 1
897+ s.Add_UInt32(flags & 7);
898+ #else
899+ static const char k_LoongArch_Float_Type[8] = { '0', 's', 'f', 'd', '4' ,'5', '6', '7' };
900+ s.Add_Char(k_LoongArch_Float_Type[flags & 7]);
901+ #endif
902+ flags &= ~(UInt32)0xff;
903+ if (flags)
904+ {
905+ s.Add_Colon();
906+ char sz[16];
907+ ConvertUInt32ToHex(flags, sz);
908+ s += sz;
909+ }
910+ }
911+ #endif
888912 else
889913 {
890914 char sz[16 ];
0 commit comments