]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Don't use mmap when _MUDFLAP is defined.
authorUlrich Drepper <drepper@redhat.com>
Fri, 2 Sep 2005 20:01:37 +0000 (20:01 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 2 Sep 2005 20:01:37 +0000 (20:01 +0000)
src/ChangeLog
src/strings.c

index 770dac822e0ab93d1bf4be3e6e220f67e38dbd7d..66b0954471e876cf41b6aabe879de8507214957b 100644 (file)
@@ -1,6 +1,7 @@
 2005-09-02  Ulrich Drepper  <drepper@redhat.com>
 
        * strings.c (main): Reset elfmap variable afte rmunmap call.
+       [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap.
 
 2005-08-28  Ulrich Drepper  <drepper@redhat.com>
 
index 40774e46af2718b5e240ab456a3580560b4a457c..d9434c928efc2c0966bc4ae6560694404d209acb 100644 (file)
@@ -448,15 +448,22 @@ process_chunk (const char *fname, const unsigned char *buf, off64_t to,
 static void *
 map_file (int fd, off64_t start_off, off64_t fdlen, size_t *map_sizep)
 {
+#if _MUDFLAP
+  (void) fd;
+  (void) start_off;
+  (void) fdlen;
+  (void) map_sizep;
+  return MAP_FAILED;
+#else
   /* Maximum size we mmap.  We use an #ifdef to avoid overflows on
      32-bit machines.  64-bit machines these days do not have usable
      address spaces larger than about 43 bits.  Not that any file
      should be that large.  */
-#if SIZE_MAX > 0xffffffff
+# if SIZE_MAX > 0xffffffff
   const size_t mmap_max = 0x4000000000lu;
-#else
+# else
   const size_t mmap_max = 0x40000000lu;
-#endif
+# endif
 
   /* Try to mmap the file.  */
   size_t map_size = MIN ((off64_t) mmap_max, fdlen);
@@ -489,6 +496,7 @@ map_file (int fd, off64_t start_off, off64_t fdlen, size_t *map_sizep)
 
   *map_sizep = map_size;
   return mem;
+#endif
 }