[llvm-dev] Recuperate return addresses of virtual and non virtual C++ methods with Clang and LLVM

Paul via llvm-dev llvm-dev at lists.llvm.org
Tue Dec 13 08:52:05 PST 2016


EDIT: I am working with this setup: LLVM +Clang Compiler for C++, Ubuntu
64bit,

I am currently looking for:

 1.

    a way to get the return addresses of virtual function call and non
    virtual C++ methods inside Clang and LLVM and

 2.

    a way to get the candidate addresses where the return address points
    back after each function return was performed.

I have a few questions and hopefully you guys can help me out.

 1.

    The return-addresses of indirect function calls to virtual functions
    (and thus v-tables), are they pointers? If not, what format do they
    have? How are those handled by Clang?

 2.

    Is the return address of a non virtual function in Clang a pointer
    or a hardcoded value?

 3.

    How can I get the return addresses of an indirect call to a virtual
    function using LLVM? Do i have to import them from Clang and make
    them available during LTO?

 4.

    Is thinLTO a better candidate for helping me recuperate this
    information?

 5.

    Does the return address of a function called from an indirect
    call-site always jump back to the next line (instruction) of
    assembly code after the callsite instruction. Are there some
    occurrences where it doesn't? How is this handled in Clang?

see also it here:
https://stackoverflow.com/questions/41019601/recuperate-return-addresses-of-virtual-and-non-virtual-c-methods-with-clang-an
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161213/e5c71138/attachment.html>


More information about the llvm-dev mailing list