[LLVMbugs] [Bug 20656] MCJIT::addGlobalMapping not mapping functions in the current object correctly

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Jul 29 12:39:36 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=20656

Lang Hames <lhames at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #32 from Lang Hames <lhames at gmail.com> ---
Hi Federico,

It looks like the global mapping code was never properly attached to MCJIT. I'm
not sure how the "fix" for this addressed Murat's bug. (Murat - did you confirm
that this actually fixed your issue?)

On MacOSX the failure was masked by the fact that RTDyldMemoryManager searches
the JIT process symbols by default as a fallback, and finds "someFunction"
there without ever looking up the global mapping. If someFunction is mapped as
"foo", the bug shows up as a failure to find foo.

I'm working on hooking this up now, and have emailed Hans to see if it's
possible to get this in to the 3.7 release.

Federico - are you caching objects in your JIT at all, or do you always build
the IR from scratch?

If the later, I have a workaround for you in case this doesn't get in:

You can inject the address of someFunction into your bitcode when you create
it, rather than referencing someFunction:

I.e., Where you would have made a call to @someFunction, instead construct:

%call = call i32 inttoptr (i64 12345678 to i32 ()*)()

substituting the address of someFunction for the integer.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150729/4017051a/attachment.html>


More information about the llvm-bugs mailing list