|
From: Jeremy F. <je...@go...> - 2005-03-21 23:21:41
|
Jeremy Fitzhardinge wrote:
>The kernel has a special workaround to deal with Kylix binaries by
>ignoring errors on that zero operation, but usermode code can't easily
>do that. I'll need to think about the nicest way to solve this (lobby
>Borland to generate proper executables would be a good start).
>
>
Turns out it was a simple fix. Try this out:
Index: valgrind/coregrind/ume.c
===================================================================
--- valgrind.orig/coregrind/ume.c 2005-03-10 21:09:43.000000000 -0800
+++ valgrind/coregrind/ume.c 2005-03-21 15:19:58.000000000 -0800
@@ -261,7 +263,7 @@ ESZ(Addr) mapelf(struct elfinfo *e, ESZ(
}
bytes = bss & (VKI_PAGE_SIZE - 1);
- if (bytes > 0) {
+ if ((prot & PROT_WRITE) && (bytes > 0)) {
bytes = VKI_PAGE_SIZE - bytes;
memset((char *)bss, 0, bytes);
}
|