From 3f2e6a2da5d9348efaa98eb06c430bec5fbe596b Mon Sep 17 00:00:00 2001 From: Cary Coutant Date: Wed, 25 Jun 2008 17:10:08 +0000 Subject: 2008-06-25 Cary Coutant * fileread.cc (File_read::make_view): Assert on zero-length view. * object.cc (Sized_relobj::do_read_symbols): Don't try to read symbol table when there are no symbols to read. --- gold/object.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gold/object.cc') diff --git a/gold/object.cc b/gold/object.cc index b49bee1..8659cb2 100644 --- a/gold/object.cc +++ b/gold/object.cc @@ -452,6 +452,12 @@ Sized_relobj::do_read_symbols(Read_symbols_data* sd) off_t readoff = this->has_eh_frame_ ? dataoff : extoff; section_size_type readsize = this->has_eh_frame_ ? datasize : extsize; + if (readsize == 0) + { + // No external symbols. Also weird but also legal. + return; + } + File_view* fvsymtab = this->get_lasting_view(readoff, readsize, true, false); // Read the section header for the symbol names. -- cgit v1.1