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(Value); } void ScalarBitSetTraits::bitset(IO &IO, 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