Index: lib/ObjectYAML/ELFYAML.cpp =================================================================== --- lib/ObjectYAML/ELFYAML.cpp +++ lib/ObjectYAML/ELFYAML.cpp @@ -892,10 +892,8 @@ if (to_integer(Name, Val)) return Val; - llvm::WithColor::error() - << "an unknown value is used for symbol's 'Other' field: " << Name - << ".\n"; - exit(1); + YamlIO.setError("an unknown value is used for symbol's 'Other' field: " + + Name); } Optional denormalize(IO &) { @@ -940,7 +938,7 @@ return Map; } - const IO &YamlIO; + IO &YamlIO; Optional> Other; std::string UnknownFlagsHolder; }; Index: test/tools/yaml2obj/elf-symbol-stother.yaml =================================================================== --- test/tools/yaml2obj/elf-symbol-stother.yaml +++ test/tools/yaml2obj/elf-symbol-stother.yaml @@ -4,7 +4,7 @@ ## to a different machine type to what is specified by the YAML. # RUN: not yaml2obj --docnum=1 2>&1 %s | FileCheck %s --check-prefix=ERR -# ERR: error: an unknown value is used for symbol's 'Other' field: STO_MIPS_OPTIONAL. +# ERR: error: an unknown value is used for symbol's 'Other' field: STO_MIPS_OPTIONAL --- !ELF FileHeader: