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

--- Comment #24 from Julian Seward <jsew...@acm.org> ---
(In reply to Ulrich Weigand from comment #23)
> However, adding calls to fnptr_to_fnentry at a high level likewise seems
> wrong, since once you've done that, you've forgotten where the function
> descriptor was and have no chance of then retrieving the correct TOC value
> to load into r2 before the call.  And in fact, the crash in comment #7 seems
> a typical example of what happens when calling a function without setting up
> its TOC pointer correctly.

Ulrich, you're right.  Valgrind actually kludges this on ppc64be, by completely
ignoring the TOC pointer question and not saving or restoring r2 across calls.
I suspect that the reason this works is that Valgrind itself is compiled into a
statically linked executable, and so there is only ever one required r2 value,
which is set up at start time and stays the same for ever more.  Does that
sound plausible?

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

Reply via email to