This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Revert the last 2 commits on pagesize_m1


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=48d96f80be260f0c8dbece14f886a0f1c1166d82

commit 48d96f80be260f0c8dbece14f886a0f1c1166d82
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Sat Apr 11 17:05:04 2015 -0700

    Revert the last 2 commits on pagesize_m1

Diff:
---
 bfd/ChangeLog |  6 ------
 bfd/cache.c   | 12 ++++--------
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8935574..207884a 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,11 +1,5 @@
 2015-04-11  H.J. Lu  <hongjiu.lu@intel.com>
 
-	* cache.c (cache_bmmap): Move pagesize_m1 ... to
-	(pagesize_m1): Here.
-	(bfd_cache_init): Initialize pagesize_m1.
-
-2015-04-11  H.J. Lu  <hongjiu.lu@intel.com>
-
 	* elf32-i386.c (elf_i386_relocate_section): Replace SYMBOLIC_BIND
 	with SYMBOL_REFERENCES_LOCAL when checking R_386_GOTOFF against
 	protected data symbol when building shared library.
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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]