summaryrefslogtreecommitdiff
path: root/gold/archive.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-11-16 18:44:20 +0000
committerIan Lance Taylor <iant@google.com>2007-11-16 18:44:20 +0000
commit11bcc19d9cc06fe602e0f190c3f1d2a216188140 (patch)
tree6ac31784f4b677826f34632f1ec8eb505ae416a3 /gold/archive.cc
parent82db7ad9b30257d55b7552cc964b05933ce891a6 (diff)
downloadbinutils-redhat-11bcc19d9cc06fe602e0f190c3f1d2a216188140.tar.gz
Ignore empty archives.
Diffstat (limited to 'gold/archive.cc')
-rw-r--r--gold/archive.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/gold/archive.cc b/gold/archive.cc
index 5862f34a6f..1442731f04 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);