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

--- Comment #8 from Paul Floyd <pjfl...@wanadoo.fr> ---
No, not quite.

It seems like Valgrind loads the exe (and normally the interpreter, which is
does with VG_(load_ELF) and readelf. I think that these read the phdrs and
shdrs, and pre-allocates the NSegements. That means that when a PT_LOAD gets
mmap'd, if there is a subsequent mmap the NSeggment is already in place.

For other libs (libc.so, varinfo50so.so for example) it's ld.so that is running
and loading them. This is doing the mmaps of the PT_LOADs one at a time. So the
NSegment lookahead does not work.

If I'm going to to lookahead, that means I'd have to do something like parsing
the ELF in the shared lib and working out if there will be further RW PT_LOAD.
Sounds hard.

Plan B. Do as now, then see the 2nd PT_LOAD and try to clean up the mess.

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

Reply via email to