EF_RISCV_RVE=0x00000008
EF_RISCV_TSO=0x00000010
+ EF_LOONGARCH_ABI=0x000000C0
+ EF_LOONGARCH_ABI_V0=0x00000000
+ EF_LOONGARCH_ABI_V1=0x00000040
+ EF_LOONGARCH_FLOAT_ABI=0x00000003
+ EF_LOONGARCH_FLOAT_ABI_SOFT=0x00000001
+ EF_LOONGARCH_FLOAT_ABI_SINGLE=0x00000002
+ EF_LOONGARCH_FLOAT_ABI_DOUBLE=0x00000003
class E_FLAGS_MASKS(object):
"""Masks to be used for convenience when working with E_FLAGS
EM_RISCV = 243, # RISC-V
EM_BPF = 247, # Linux BPF - in-kernel virtual machine
EM_CSKY = 252, # C-SKY
+ EM_LOONGARCH = 258, # LoongArch
EM_FRV = 0x5441, # Fujitsu FR-V
# Reservations
# reserved 11-14 Reserved for future use
if (flags & E_FLAGS.EF_RISCV_FLOAT_ABI) == E_FLAGS.EF_RISCV_FLOAT_ABI_QUAD:
description += ", quad-float ABI"
+ elif self.elffile['e_machine'] == "EM_LOONGARCH":
+ if (flags & E_FLAGS.EF_LOONGARCH_FLOAT_ABI) == E_FLAGS.EF_LOONGARCH_FLOAT_ABI_SOFT:
+ description += ", SOFT-FLOAT"
+ if (flags & E_FLAGS.EF_LOONGARCH_FLOAT_ABI) == E_FLAGS.EF_LOONGARCH_FLOAT_ABI_SINGLE:
+ description += ", SINGLE-FLOAT"
+ if (flags & E_FLAGS.EF_LOONGARCH_FLOAT_ABI) == E_FLAGS.EF_LOONGARCH_FLOAT_ABI_DOUBLE:
+ description += ", DOUBLE-FLOAT"
+ if (flags & E_FLAGS.EF_LOONGARCH_ABI) == E_FLAGS.EF_LOONGARCH_ABI_V0:
+ description += ", OBJ-v0"
+ if (flags & E_FLAGS.EF_LOONGARCH_ABI) == E_FLAGS.EF_LOONGARCH_ABI_V1:
+ description += ", OBJ-v1"
+
return description
def display_program_headers(self, show_heading=True):