From 11bcc19d9cc06fe602e0f190c3f1d2a216188140 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 16 Nov 2007 18:44:20 +0000 Subject: [PATCH] Ignore empty archives. --- gold/archive.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gold/archive.cc b/gold/archive.cc index 5862f34a6..1442731f0 100644 --- a/gold/archive.cc +++ b/gold/archive.cc @@ -75,6 +75,13 @@ const char Archive::arfmag[2] = { '`', '\n' }; void Archive::setup() { + // We need to ignore empty archives. + if (this->input_file_->file().filesize() == sarmag) + { + this->input_file_->file().unlock(); + return; + } + // The first member of the archive should be the symbol table. std::string armap_name; off_t armap_size = this->read_header(sarmag, &armap_name); -- 2.11.4.GIT