From: Julian Seward Date: Mon, 3 Jun 2002 23:22:23 +0000 (+0000) Subject: Call VG_(read_symbols) also from the new __NR_mmap2. X-Git-Tag: svn/VALGRIND_1_0_3~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c97d658bda791a52ba7c037f2945ac09e354a81e;p=thirdparty%2Fvalgrind.git Call VG_(read_symbols) also from the new __NR_mmap2. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@371 --- diff --git a/vg_syscall_mem.c b/vg_syscall_mem.c index 0e8ad1d1b1..5fc3cc7dda 100644 --- a/vg_syscall_mem.c +++ b/vg_syscall_mem.c @@ -2140,10 +2140,17 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid ) VG_(printf)("mmap2 ( %p, %d, %d, %d, %d, %d )\n", arg1, arg2, arg3, arg4, arg5, arg6 ); KERNEL_DO_SYSCALL(tid,res); - /* !!! shouldn't we also be doing the symtab loading stuff as - in __NR_mmap ? */ if (!VG_(is_kerror)(res)) approximate_mmap_permissions( (Addr)res, arg2, arg3 ); + if (!VG_(is_kerror)(res) + && (arg3 & PROT_EXEC)) { + /* The client mmap'ed a segment with executable + permissions. Tell the symbol-table loader, so that it + has an opportunity to pick up more symbols if this mmap + was caused by the client loading a new .so via + dlopen(). This is important for debugging KDE. */ + VG_(read_symbols)(); + } } break; # endif