https://bugs.kde.org/show_bug.cgi?id=353192

--- Comment #13 from Paul Floyd <[email protected]> ---
(In reply to Fredrik Tolf from comment #12)
> Seems either clang or lld does something different, then. The problem for me
> on Debian is that  ld apparently merges the .data section with my .foo
> section into one RWX segment, and Valgrind (without patching) apparently
> doesn't consider a mapping without at least one pure RX and one pure RW
> section to be a program mapping.
> 
> If you ask me, I think Valgrind should recognize mappings to load debug
> symbols from by their having an ELF signature, rather than by some segment
> property heuristic, but maybe that has other weird consequences that I
> haven't foreseen.

I agree. I've already changed the code for rw- segments to use the ELF program
header number of segments rather than a hard counted value of 1.
We should do he same for r-x (and rwx).

There are two big headaches.
1. As you see in the code there is a lot of variation between platforms. I'm
not sure if it's possible to have code that is genuinely generic and cross
platform.
2. This code gets called both for binaries that are already loaded and whenever
the guest loads a binary (at startup of via dlopen). The "already loaded" case
is horrible as Valgrind may have merged segments that are contiguous.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to