Index: lib/ObjectYAML/ELFYAML.cpp =================================================================== --- lib/ObjectYAML/ELFYAML.cpp +++ lib/ObjectYAML/ELFYAML.cpp @@ -542,6 +542,7 @@ llvm_unreachable("Unsupported architecture"); } #undef ELF_RELOC + IO.enumFallback(Value); } void ScalarEnumerationTraits::enumeration( Index: test/Object/X86/yaml-elf-x86-rel-broken.yaml =================================================================== --- test/Object/X86/yaml-elf-x86-rel-broken.yaml +++ test/Object/X86/yaml-elf-x86-rel-broken.yaml @@ -0,0 +1,48 @@ +# RUN: yaml2obj %s > %t +# RUN: obj2yaml %t | FileCheck %s + +# CHECK: --- !ELF +# CHECK-NEXT: FileHeader: +# CHECK-NEXT: Class: ELFCLASS32 +# CHECK-NEXT: Data: ELFDATA2LSB +# CHECK-NEXT: Type: ET_REL +# CHECK-NEXT: Machine: EM_386 +# CHECK-NEXT: Sections: +# CHECK-NEXT: - Name: .text +# CHECK-NEXT: Type: SHT_PROGBITS +# CHECK-NEXT: Flags: [ SHF_ALLOC, SHF_EXECINSTR ] +# CHECK-NEXT: AddressAlign: 0x0000000000000004 +# CHECK-NEXT: Content: '0000000000000000' +# CHECK-NEXT: - Name: .rel.text +# CHECK-NEXT: Type: SHT_REL +# CHECK-NEXT: Link: .symtab +# CHECK-NEXT: AddressAlign: 0x0000000000000004 +# CHECK-NEXT: Info: .text +# CHECK-NEXT: Relocations: +# CHECK-NEXT: - Offset: 0x0000000000000000 +# CHECK-NEXT: Symbol: '' +# CHECK-NEXT: Type: 0x000000FF +# CHECK-NEXT: Symbols: +# CHECK-NEXT: ... + +!ELF +FileHeader: + Class: ELFCLASS32 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_386 +Sections: + - Type: SHT_PROGBITS + Name: .text + Flags: [ SHF_ALLOC, SHF_EXECINSTR ] + AddressAlign: 0x04 + Content: 0000000000000000 + - Type: SHT_REL + Name: .rel.text + Link: .symtab + Info: .text + AddressAlign: 0x04 + Relocations: + - Offset: 0 + Symbol: main + Type: 0xFF