<div dir="ltr">I think I found the answer to #3 and #4.<div>(a) I overloaded the SectionMemoryManager::finalizeMemory(...) method. </div><div>(b) I first call the base classes method (maybe not necessary).</div><div>(c) At this point the __llvm_stackmaps section that I saved in thread local memory when allocateDataSection was called appears to be fully set up and relocated.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 5, 2018 at 12:36 PM Christian Schafmeister <<a href="mailto:meister@temple.edu">meister@temple.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>I have a few questions about the new ORC JIT.</div><div><br></div><div>I saw Lang Hames (hi!) excellent talk at the llvm-dev meeting a few weeks ago. The ORC JIT is undergoing some API changes and I'd like/need to take advantage of them.</div><div><br></div><div>(1) How do I take ownership of the ObjectFile once the ORC JIT has created it?</div><div>    I'd like to take ownership of object files generated by the ORC JIT so that I can save them to disk and in later sessions reload them.</div><div>(2) How would I pass an ObjectFile saved in question#1 back to ORC so that it will relocate it and generate function pointers?</div><div>(3) How do I get access to the relocated ObjectFile sections?</div><div>    Currently I subclass SectionMemoryManager and implement allocateDataSection(...)</div><div>    I can get the memory for the "__llvm_stackmaps" section - but I don't know when/if the contents have been fully set up with relocated function pointers.</div><div>(4) For the "__llvm_stackmaps" section - will I need to do any relocation to obtain the function pointers?</div><div><br></div><div>Background:</div><div>I'm using llvm.experimental.stackmaps to register one variable in each stack frame that contains spilled register arguments.</div><div>I've figured out how to get access to the stackmaps for code that I load into my system from dynamic libraries that our compiler generates.</div><div>The answers to questions above will help me get access to the stackmaps from ORC JITted code.</div><div><br></div>-- <br><div dir="ltr" class="m_5097034966196357672gmail_signature"><div dir="ltr"><div style="font-size:small">Christian Schafmeister</div><div style="font-size:small">Professor, Chemistry Department</div><div style="font-size:small">Temple University</div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div style="font-size:small">Christian Schafmeister</div><div style="font-size:small">Professor, Chemistry Department</div><div style="font-size:small">Temple University</div></div></div>