aboutsummaryrefslogtreecommitdiff
path: root/gold/fileread.cc
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2008-06-25 17:10:08 +0000
committerCary Coutant <ccoutant@google.com>2008-06-25 17:10:08 +0000
commit3f2e6a2da5d9348efaa98eb06c430bec5fbe596b (patch)
treebcc83ddeb7ca9e2c1b44767bb6246ffecd594b92 /gold/fileread.cc
parentc8187e1509b28d4d9c0bbc2de688144ef80537c0 (diff)
downloadgdb-3f2e6a2da5d9348efaa98eb06c430bec5fbe596b.zip
gdb-3f2e6a2da5d9348efaa98eb06c430bec5fbe596b.tar.gz
gdb-3f2e6a2da5d9348efaa98eb06c430bec5fbe596b.tar.bz2
2008-06-25 Cary Coutant <ccoutant@google.com>
* 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.
Diffstat (limited to 'gold/fileread.cc')
-rw-r--r--gold/fileread.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gold/fileread.cc b/gold/fileread.cc
index 6cb056f..cfe0ee6 100644
--- a/gold/fileread.cc
+++ b/gold/fileread.cc
@@ -327,6 +327,8 @@ File_read::View*
File_read::make_view(off_t start, section_size_type size,
unsigned int byteshift, bool cache)
{
+ gold_assert(size > 0);
+
off_t poff = File_read::page_offset(start);
section_size_type psize = File_read::pages(size + (start - poff));