diff --git a/llvm/include/llvm/BinaryFormat/ELF.h b/llvm/include/llvm/BinaryFormat/ELF.h --- a/llvm/include/llvm/BinaryFormat/ELF.h +++ b/llvm/include/llvm/BinaryFormat/ELF.h @@ -652,7 +652,8 @@ EF_RISCV_FLOAT_ABI_SINGLE = 0x0002, EF_RISCV_FLOAT_ABI_DOUBLE = 0x0004, EF_RISCV_FLOAT_ABI_QUAD = 0x0006, - EF_RISCV_RVE = 0x0008 + EF_RISCV_RVE = 0x0008, + EF_RISCV_TSO = 0x0010, }; // ELF Relocation types for RISC-V diff --git a/llvm/lib/ObjectYAML/ELFYAML.cpp b/llvm/lib/ObjectYAML/ELFYAML.cpp --- a/llvm/lib/ObjectYAML/ELFYAML.cpp +++ b/llvm/lib/ObjectYAML/ELFYAML.cpp @@ -505,6 +505,7 @@ BCaseMask(EF_RISCV_FLOAT_ABI_DOUBLE, EF_RISCV_FLOAT_ABI); BCaseMask(EF_RISCV_FLOAT_ABI_QUAD, EF_RISCV_FLOAT_ABI); BCase(EF_RISCV_RVE); + BCase(EF_RISCV_TSO); break; case ELF::EM_AMDGPU: BCaseMask(EF_AMDGPU_MACH_NONE, EF_AMDGPU_MACH); diff --git a/llvm/test/Object/RISCV/elf-flags.yaml b/llvm/test/Object/RISCV/elf-flags.yaml --- a/llvm/test/Object/RISCV/elf-flags.yaml +++ b/llvm/test/Object/RISCV/elf-flags.yaml @@ -2,10 +2,11 @@ # RUN: llvm-readobj --file-headers %t | FileCheck -check-prefix=OBJ %s # RUN: obj2yaml %t | FileCheck -check-prefix=YAML %s -# OBJ: Flags [ (0xD) +# OBJ: Flags [ (0x1D) # OBJ-NEXT: EF_RISCV_FLOAT_ABI_DOUBLE (0x4) # OBJ-NEXT: EF_RISCV_RVC (0x1) # OBJ-NEXT: EF_RISCV_RVE (0x8) +# OBJ-NEXT: EF_RISCV_TSO (0x10) # OBJ-NEXT: ] # YAML: FileHeader: @@ -13,7 +14,7 @@ # YAML-NEXT: Data: ELFDATA2LSB # YAML-NEXT: Type: ET_EXEC # YAML-NEXT: Machine: EM_RISCV -# YAML-NEXT: Flags: [ EF_RISCV_RVC, EF_RISCV_FLOAT_ABI_DOUBLE, EF_RISCV_RVE ] +# YAML-NEXT: Flags: [ EF_RISCV_RVC, EF_RISCV_FLOAT_ABI_DOUBLE, EF_RISCV_RVE, EF_RISCV_TSO ] --- !ELF FileHeader: @@ -21,4 +22,4 @@ Data: ELFDATA2LSB Type: ET_EXEC Machine: EM_RISCV - Flags: [ EF_RISCV_RVC, EF_RISCV_FLOAT_ABI_DOUBLE, EF_RISCV_RVE ] + Flags: [ EF_RISCV_RVC, EF_RISCV_FLOAT_ABI_DOUBLE, EF_RISCV_RVE, EF_RISCV_TSO ] diff --git a/llvm/tools/llvm-readobj/ELFDumper.cpp b/llvm/tools/llvm-readobj/ELFDumper.cpp --- a/llvm/tools/llvm-readobj/ELFDumper.cpp +++ b/llvm/tools/llvm-readobj/ELFDumper.cpp @@ -1567,7 +1567,8 @@ ENUM_ENT(EF_RISCV_FLOAT_ABI_SINGLE, "single-float ABI"), ENUM_ENT(EF_RISCV_FLOAT_ABI_DOUBLE, "double-float ABI"), ENUM_ENT(EF_RISCV_FLOAT_ABI_QUAD, "quad-float ABI"), - ENUM_ENT(EF_RISCV_RVE, "RVE") + ENUM_ENT(EF_RISCV_RVE, "RVE"), + ENUM_ENT(EF_RISCV_TSO, "TSO"), }; static const EnumEntry ElfHeaderAVRFlags[] = {