From: Ulrich Drepper Date: Fri, 2 Sep 2005 20:01:37 +0000 (+0000) Subject: Don't use mmap when _MUDFLAP is defined. X-Git-Tag: elfutils-0.120~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=618795fbfd64f2dd1fa4375ce704736c70725412;p=thirdparty%2Felfutils.git Don't use mmap when _MUDFLAP is defined. --- diff --git a/src/ChangeLog b/src/ChangeLog index 770dac822..66b095447 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,6 +1,7 @@ 2005-09-02 Ulrich Drepper * strings.c (main): Reset elfmap variable afte rmunmap call. + [_MUDFLAP] (map_file): Simplify mudflap debugging by not using mmap. 2005-08-28 Ulrich Drepper diff --git a/src/strings.c b/src/strings.c index 40774e46a..d9434c928 100644 --- a/src/strings.c +++ b/src/strings.c @@ -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 }