From: Alan Modra <amodra@sourceware.org>
To: binutils-cvs@sourceware.org
Subject: [binutils-gdb] Remove dead code in bfdwin.c
Date: Tue, 9 Apr 2024 02:00:33 +0000 (GMT) [thread overview]
Message-ID: <20240409020033.C5A4A3858282@sourceware.org> (raw)
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7c71e67e119eb36f62803797640b7638bac6d5e8
commit 7c71e67e119eb36f62803797640b7638bac6d5e8
Author: Alan Modra <amodra@gmail.com>
Date: Tue Apr 9 08:50:23 2024 +0930
Remove dead code in bfdwin.c
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.
Diff:
---
bfd/bfdwin.c | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/bfd/bfdwin.c b/bfd/bfdwin.c
index 73e44635bcb..0ef7b1418b9 100644
--- a/bfd/bfdwin.c
+++ b/bfd/bfdwin.c
@@ -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)
reply other threads:[~2024-04-09 2:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240409020033.C5A4A3858282@sourceware.org \
--to=amodra@sourceware.org \
--cc=binutils-cvs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).