]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't mark segments as SF_FIXED when VKI_MAP_FIXED isn't specified.
authorNicholas Nethercote <njn@valgrind.org>
Tue, 28 Jun 2005 02:45:29 +0000 (02:45 +0000)
committerNicholas Nethercote <njn@valgrind.org>
Tue, 28 Jun 2005 02:45:29 +0000 (02:45 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4039

coregrind/m_libcmman.c

index cf4fd3a8f5d2ec56f9eb0499de616b75f23f6092..59a0df117f0dac4aed91d50a6b80aed4404245bd 100644 (file)
@@ -46,14 +46,12 @@ void* VG_(mmap)( void* start, SizeT length,
 
    if (!(flags & VKI_MAP_FIXED)) {
       start = (void *)VG_(find_map_space)((Addr)start, length, !!(flags & VKI_MAP_CLIENT));
-
-      flags |= VKI_MAP_FIXED;
    }
    if (start == 0)
       return (void *)-1;
 
    res = VG_(mmap_native)(start, length, prot, 
-                          flags & ~(VKI_MAP_NOSYMS | VKI_MAP_CLIENT),
+                          (flags | VKI_MAP_FIXED) & ~(VKI_MAP_NOSYMS | VKI_MAP_CLIENT),
                           fd, offset);
 
    // Check it ended up in the right place.