aboutsummaryrefslogtreecommitdiff
path: root/bfd/cache.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-04-11 17:05:04 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-04-11 19:34:42 -0700
commit48d96f80be260f0c8dbece14f886a0f1c1166d82 (patch)
tree27fd12e5429c31fd2cede3891b1de32ebd44c714 /bfd/cache.c
parente46c4f6cc80e078ef5f7dd0a7dcc01740bea3e65 (diff)
downloadgdb-48d96f80be260f0c8dbece14f886a0f1c1166d82.zip
gdb-48d96f80be260f0c8dbece14f886a0f1c1166d82.tar.gz
gdb-48d96f80be260f0c8dbece14f886a0f1c1166d82.tar.bz2
Revert the last 2 commits on pagesize_m1
Diffstat (limited to 'bfd/cache.c')
-rw-r--r--bfd/cache.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/bfd/cache.c b/bfd/cache.c
index a0a02e4..94a82da 100644
--- a/bfd/cache.c
+++ b/bfd/cache.c
@@ -418,10 +418,6 @@ cache_bstat (struct bfd *abfd, struct stat *sb)
return sts;
}
-#ifdef HAVE_MMAP
-static uintptr_t pagesize_m1;
-#endif
-
static void *
cache_bmmap (struct bfd *abfd ATTRIBUTE_UNUSED,
void *addr ATTRIBUTE_UNUSED,
@@ -439,6 +435,7 @@ cache_bmmap (struct bfd *abfd ATTRIBUTE_UNUSED,
#ifdef HAVE_MMAP
else
{
+ static uintptr_t pagesize_m1;
FILE *f;
file_ptr pg_offset;
bfd_size_type pg_len;
@@ -447,6 +444,9 @@ cache_bmmap (struct bfd *abfd ATTRIBUTE_UNUSED,
if (f == NULL)
return ret;
+ if (pagesize_m1 == 0)
+ pagesize_m1 = getpagesize () - 1;
+
/* Handle archive members. */
if (abfd->my_archive != NULL)
offset += abfd->origin;
@@ -496,10 +496,6 @@ bfd_cache_init (bfd *abfd)
if (! close_one ())
return FALSE;
}
-#ifdef HAVE_MMAP
- if (pagesize_m1 == 0)
- pagesize_m1 = getpagesize () - 1;
-#endif
abfd->iovec = &cache_iovec;
insert (abfd);
++open_files;