[PATCH] D111939: [RISCV] Add missing e_flag R_RISCV_TSO

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 16 07:29:34 PDT 2021


StephenFan updated this revision to Diff 380183.
StephenFan added a comment.

@jrtc27 Thanks for your review!

1. Change commit log.
2. Add end line and change format.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111939/new/

https://reviews.llvm.org/D111939

Files:
  llvm/include/llvm/BinaryFormat/ELF.h
  llvm/lib/ObjectYAML/ELFYAML.cpp
  llvm/test/Object/RISCV/elf-flags.yaml
  llvm/tools/llvm-readobj/ELFDumper.cpp


Index: llvm/tools/llvm-readobj/ELFDumper.cpp
===================================================================
--- llvm/tools/llvm-readobj/ELFDumper.cpp
+++ llvm/tools/llvm-readobj/ELFDumper.cpp
@@ -1563,11 +1563,12 @@
 };
 
 static const EnumEntry<unsigned> ElfHeaderRISCVFlags[] = {
-  ENUM_ENT(EF_RISCV_RVC, "RVC"),
-  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_RVC, "RVC"),
+    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_TSO, "TSO")
 };
 
 static const EnumEntry<unsigned> ElfHeaderAVRFlags[] = {
Index: llvm/test/Object/RISCV/elf-flags.yaml
===================================================================
--- llvm/test/Object/RISCV/elf-flags.yaml
+++ 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 ]
Index: llvm/lib/ObjectYAML/ELFYAML.cpp
===================================================================
--- llvm/lib/ObjectYAML/ELFYAML.cpp
+++ 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);
Index: llvm/include/llvm/BinaryFormat/ELF.h
===================================================================
--- llvm/include/llvm/BinaryFormat/ELF.h
+++ 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111939.380183.patch
Type: text/x-patch
Size: 3019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211016/e9e20958/attachment.bin>


More information about the llvm-commits mailing list