[PATCH] D71765: [yaml2obj] - Allow using an arbitrary value for OSABI.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 23 02:33:10 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf027e1a68dac: [yaml2obj] - Allow using an arbitrary value for OSABI. (authored by grimar).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71765

Files:
  llvm/lib/ObjectYAML/ELFYAML.cpp
  llvm/test/tools/yaml2obj/ELF/header-osabi.yaml


Index: llvm/test/tools/yaml2obj/ELF/header-osabi.yaml
===================================================================
--- llvm/test/tools/yaml2obj/ELF/header-osabi.yaml
+++ llvm/test/tools/yaml2obj/ELF/header-osabi.yaml
@@ -325,3 +325,16 @@
   Type:    ET_REL
   Machine: EM_X86_64
   OSABI:   ELFOSABI_STANDALONE
+
+## Test we can use an arbitrary number for OSABI.
+# RUN: yaml2obj %s --docnum=27 -o %t.number
+# RUN: llvm-readobj --file-headers %t.number | FileCheck %s --check-prefix=OSABI-NUMBER
+# OSABI-NUMBER: OS/ABI: 0xFE
+
+--- !ELF
+FileHeader:
+  Class:   ELFCLASS64
+  Data:    ELFDATA2LSB
+  Type:    ET_REL
+  Machine: EM_X86_64
+  OSABI:   0xFE
Index: llvm/lib/ObjectYAML/ELFYAML.cpp
===================================================================
--- llvm/lib/ObjectYAML/ELFYAML.cpp
+++ llvm/lib/ObjectYAML/ELFYAML.cpp
@@ -275,6 +275,7 @@
   ECase(ELFOSABI_C6000_LINUX);
   ECase(ELFOSABI_STANDALONE);
 #undef ECase
+  IO.enumFallback<Hex8>(Value);
 }
 
 void ScalarBitSetTraits<ELFYAML::ELF_EF>::bitset(IO &IO,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71765.235122.patch
Type: text/x-patch
Size: 1037 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191223/20e83ab6/attachment.bin>


More information about the llvm-commits mailing list