Index: lib/ObjectYAML/ELFYAML.cpp =================================================================== --- lib/ObjectYAML/ELFYAML.cpp +++ lib/ObjectYAML/ELFYAML.cpp @@ -572,6 +572,7 @@ ECase(STT_TLS); ECase(STT_GNU_IFUNC); #undef ECase + IO.enumFallback(Value); } void ScalarEnumerationTraits::enumeration( Index: test/tools/obj2yaml/symbol-type.yaml =================================================================== --- test/tools/obj2yaml/symbol-type.yaml +++ test/tools/obj2yaml/symbol-type.yaml @@ -0,0 +1,22 @@ +# RUN: yaml2obj %s > %t +# RUN: obj2yaml %t | FileCheck %s + +# CHECK: Symbols: +# CHECK-NEXT: Global: +# CHECK-NEXT: - Name: a_known_type +# CHECK-NEXT: Type: STT_OBJECT +# CHECK-NEXT: - Name: an_unknown_type +# CHECK-NEXT: Type: 0x07 + +!ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 +Symbols: + Global: + - Name: a_known_type + Type: STT_OBJECT + - Name: an_unknown_type + Type: 0x7 Index: test/tools/yaml2obj/symbol-type.yaml =================================================================== --- test/tools/yaml2obj/symbol-type.yaml +++ test/tools/yaml2obj/symbol-type.yaml @@ -0,0 +1,43 @@ +# RUN: yaml2obj %s > %t +# RUN: llvm-readobj --symbols %t | FileCheck %s + +# CHECK: Name: notype +# CHECK: Type: None +# CHECK: Name: normal_type +# CHECK: Type: Object +# CHECK: Name: .text +# CHECK: Type: Section +# CHECK: Name: known_hex +# CHECK: Type: Object +# CHECK: Name: unknown_hex +# CHECK: Type: 0xB +# CHECK: Name: known_int +# CHECK: Type: Object +# CHECK: Name: unknown_int +# CHECK: Type: 0xB + +!ELF +FileHeader: + Class: ELFCLASS64 + Data: ELFDATA2LSB + Type: ET_REL + Machine: EM_X86_64 +Sections: + - Name: .text + Type: SHT_PROGBITS +Symbols: + Global: + - Name: notype + Type: STT_NOTYPE + - Name: normal_type + Type: STT_OBJECT + - Name: .text + Type: STT_SECTION + - Name: known_hex + Type: 0x1 + - Name: unknown_hex + Type: 0xb + - Name: known_int + Type: 1 + - Name: unknown_int + Type: 11