aboutsummaryrefslogtreecommitdiff
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
commit3e95a404c8ed29f01447b979392c203a846f6f2f (patch)
tree1b9078db376577d853b25e0a829dca794d00c930 /gold/archive.cc
parentee50f563b94ab01506b3a02b28b1123000676a29 (diff)
downloadgdb-3e95a404c8ed29f01447b979392c203a846f6f2f.zip
gdb-3e95a404c8ed29f01447b979392c203a846f6f2f.tar.gz
gdb-3e95a404c8ed29f01447b979392c203a846f6f2f.tar.bz2
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 5862f34..1442731 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);