258 changes: 0 additions & 258 deletions lld/lib/ReaderWriter/Native/NativeFileFormat.h

This file was deleted.

881 changes: 0 additions & 881 deletions lld/lib/ReaderWriter/Native/ReaderNative.cpp

This file was deleted.

566 changes: 0 additions & 566 deletions lld/lib/ReaderWriter/Native/WriterNative.cpp

This file was deleted.

9 changes: 4 additions & 5 deletions lld/lib/ReaderWriter/PECOFF/ReaderCOFF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,10 @@ std::error_code FileCOFF::doParse() {

if (getMachineType() != llvm::COFF::IMAGE_FILE_MACHINE_UNKNOWN &&
getMachineType() != _ctx.getMachineType()) {
llvm::errs() << "module machine type '"
<< getMachineName(getMachineType())
<< "' conflicts with target machine type '"
<< getMachineName(_ctx.getMachineType()) << "'\n";
return NativeReaderError::conflicting_target_machine;
return make_dynamic_error_code(Twine("module machine type '") +
getMachineName(getMachineType()) +
"' conflicts with target machine type '" +
getMachineName(_ctx.getMachineType()) + "'");
}

if (std::error_code ec = getReferenceArch(_referenceArch))
Expand Down
2 changes: 1 addition & 1 deletion lld/lib/ReaderWriter/PECOFF/ReaderImportHeader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ class FileImportLibrary : public File {

// Check if the total size is valid.
if (std::size_t(end - buf) != sizeof(COFF::ImportHeader) + dataSize)
return make_error_code(NativeReaderError::unknown_file_format);
return make_dynamic_error_code(StringRef("Broken import library"));

uint16_t hint = read16le(buf + offsetof(COFF::ImportHeader, OrdinalHint));
StringRef symbolName(buf + sizeof(COFF::ImportHeader));
Expand Down