diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/7zip/Archive/ElfHandler.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/CPP/7zip/Archive/ElfHandler.cpp b/CPP/7zip/Archive/ElfHandler.cpp index 305173b..df22995 100644 --- a/CPP/7zip/Archive/ElfHandler.cpp +++ b/CPP/7zip/Archive/ElfHandler.cpp | |||
@@ -628,6 +628,7 @@ static const char * const g_Machines[] = | |||
628 | static const CUInt32PCharPair g_MachinePairs[] = | 628 | static const CUInt32PCharPair g_MachinePairs[] = |
629 | { | 629 | { |
630 | { 243, "RISC-V" }, | 630 | { 243, "RISC-V" }, |
631 | { 258, "LoongArch" }, | ||
631 | { 0x9026, "Alpha" }, // EM_ALPHA_EXP, obsolete, (used by NetBSD/alpha) (written in the absence of an ABI) | 632 | { 0x9026, "Alpha" }, // EM_ALPHA_EXP, obsolete, (used by NetBSD/alpha) (written in the absence of an ABI) |
632 | { 0xbaab, "Xilinx MicroBlaze" } | 633 | { 0xbaab, "Xilinx MicroBlaze" } |
633 | }; | 634 | }; |
@@ -853,10 +854,9 @@ Z7_COM7F_IMF(CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)) | |||
853 | else if (_header.Machine == k_Machine_MIPS) | 854 | else if (_header.Machine == k_Machine_MIPS) |
854 | { | 855 | { |
855 | const UInt32 ver = flags >> 28; | 856 | const UInt32 ver = flags >> 28; |
856 | s += "v"; | 857 | s.Add_Char('v'); |
857 | s.Add_UInt32(ver); | 858 | s.Add_UInt32(ver); |
858 | flags &= ((UInt32)1 << 28) - 1; | 859 | flags &= ((UInt32)1 << 28) - 1; |
859 | |||
860 | const UInt32 abi = (flags >> 12) & 7; | 860 | const UInt32 abi = (flags >> 12) & 7; |
861 | if (abi) | 861 | if (abi) |
862 | { | 862 | { |
@@ -864,7 +864,6 @@ Z7_COM7F_IMF(CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)) | |||
864 | s.Add_UInt32(abi); | 864 | s.Add_UInt32(abi); |
865 | } | 865 | } |
866 | flags &= ~((UInt32)7 << 12); | 866 | flags &= ~((UInt32)7 << 12); |
867 | |||
868 | s.Add_Space(); | 867 | s.Add_Space(); |
869 | s += FlagsToString(g_MIPS_Flags, Z7_ARRAY_SIZE(g_MIPS_Flags), flags); | 868 | s += FlagsToString(g_MIPS_Flags, Z7_ARRAY_SIZE(g_MIPS_Flags), flags); |
870 | } | 869 | } |
@@ -885,6 +884,31 @@ Z7_COM7F_IMF(CHandler::GetArchiveProperty(PROPID propID, PROPVARIANT *value)) | |||
885 | flags &= ~(UInt32)6; | 884 | flags &= ~(UInt32)6; |
886 | s += FlagsToString(g_RISCV_Flags, Z7_ARRAY_SIZE(g_RISCV_Flags), flags); | 885 | s += FlagsToString(g_RISCV_Flags, Z7_ARRAY_SIZE(g_RISCV_Flags), flags); |
887 | } | 886 | } |
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 | ||
888 | else | 912 | else |
889 | { | 913 | { |
890 | char sz[16]; | 914 | char sz[16]; |