Introduce program_space::add_objfile
[deliverable/binutils-gdb.git] / bfd / bfdio.c
index 136fa8b1d3f0f43dddc6b76cb28efcdc19b9b25d..92dd9803e70a51fbc5fc634ebb8d8746261673aa 100644 (file)
@@ -1,6 +1,6 @@
 /* Low-level I/O routines for BFDs.
 
-   Copyright (C) 1990-2018 Free Software Foundation, Inc.
+   Copyright (C) 1990-2019 Free Software Foundation, Inc.
 
    Written by Cygnus Support.
 
@@ -330,6 +330,10 @@ bfd_seek (bfd *abfd, file_ptr position, int direction)
   if (direction != SEEK_CUR)
     position += offset;
 
+  if ((direction == SEEK_CUR && position == 0)
+      || (direction == SEEK_SET && (ufile_ptr) position == abfd->where))
+    return 0;
+
   result = abfd->iovec->bseek (abfd, position, direction);
   if (result != 0)
     {
This page took 0.025069 seconds and 4 git commands to generate.