1f0862a
--- binutils.orig/gold/fileread.cc	2019-08-06 14:22:08.669313110 +0100
1f0862a
+++ binutils-2.32/gold/fileread.cc	2019-08-06 14:22:28.799177543 +0100
1f0862a
@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_
1f0862a
   ssize_t bytes;
1f0862a
   if (this->whole_file_view_ != NULL)
1f0862a
     {
1f0862a
+      // See PR 23765 for an example of a testcase that triggers this error.
1f0862a
+      if (((ssize_t) start) < 0)
1f0862a
+	gold_fatal(_("%s: read failed, starting offset (%#llx) less than zero"),
1f0862a
+		   this->filename().c_str(),
1f0862a
+		   static_cast<long long>(start));
1f0862a
+	
1f0862a
       bytes = this->size_ - start;
1f0862a
       if (static_cast<section_size_type>(bytes) >= size)
1f0862a
 	{