]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove dead code in bfdwin.c
authorAlan Modra <amodra@gmail.com>
Mon, 8 Apr 2024 23:20:23 +0000 (08:50 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 9 Apr 2024 01:51:57 +0000 (11:21 +0930)
All of bfdwin.c is wrapped in USE_MMAP.  There isn't any point in
HAVE_MMAP tests inside USE_MMAP.

* bfdwin.c (bfd_free_window, bfd_get_file_window): Delete
HAVE_MMAP conditionals.

bfd/bfdwin.c

index 73e44635bcb251619df8def71b6b3664b7796f45..0ef7b1418b9b635a9ab089e8afb8c02e819ff0ea 100644 (file)
@@ -118,20 +118,14 @@ bfd_free_window (bfd_window *windowp)
 
   if (i->mapped)
     {
-#ifdef HAVE_MMAP
       munmap (i->data, i->size);
       goto no_free;
-#else
-      abort ();
-#endif
     }
 #ifdef HAVE_MPROTECT
   mprotect (i->data, i->size, PROT_READ | PROT_WRITE);
 #endif
   free (i->data);
-#ifdef HAVE_MMAP
  no_free:
-#endif
   i->data = 0;
   /* There should be no more references to i at this point.  */
   free (i);
@@ -174,7 +168,6 @@ bfd_get_file_window (bfd *abfd,
        return false;
       i->data = NULL;
     }
-#ifdef HAVE_MMAP
   if (ok_to_map
       && (i->data == NULL || i->mapped == 1)
       && (abfd->flags & BFD_IN_MEMORY) == 0)
@@ -249,9 +242,6 @@ bfd_get_file_window (bfd *abfd,
       else
        fprintf (stderr, _("not mapping: env var not set\n"));
     }
-#else
-  ok_to_map = 0;
-#endif
 
 #ifdef HAVE_MPROTECT
   if (!writable)