<div dir="ltr">I have updated the patch. Sorry this took a while but I've had to think about whether there are any better ways to do this. You may have seen my thread of llvmdev. I'm a little frustrated with MachO at this point, but after experimenting with the possible alternatives for a while I came back to this. I replaced the arbitrary cutoff by a heuristic based on LLVMs algorithm (i.e. it will always work for LLVM generated MachO files). I think that is good enough for now. If there are more clients out there, and they do something different, we can look at revising the heuristic. The best thing to fix this would be to reserve a flag on the section that indicates that the section has been runtime relocated, so if the people behind MachO would be willing to consider that that'd be awesome. Otherwise the heuristic works fine for now though. The other two concerns were fixed as discussed. <div>

<br></div><div>I'm still a little disappointed that we probably won't be able to avoid relocating the debug info on the MCJIT side (see the llvmdev thread I started on the semantics of X86_64_RELOC_UNSIGNED). I guess the only thing we could do is still apply the relocation but do it in place. Not great, but probably worth it to avoid the extra copy of the debug info especially since debug info can get pretty large.</div>

</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 5, 2014 at 2:26 PM, Greg Clayton <span dir="ltr"><<a href="mailto:gclayton@apple.com" target="_blank">gclayton@apple.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class=""><br>
> On Jun 5, 2014, at 10:44 AM, Keno Fischer <<a href="mailto:kfischer@college.harvard.edu">kfischer@college.harvard.edu</a>> wrote:<br>
><br>
> I missed your question about macho file types. These are all MH_OBJECTs.<br>
<br>
</div>Then you might be able to key off of that instead of always trying to read from the load commands.<br>
<br>
It would then be:<br>
<br>
if (process && m_header.filetype != llvm::MachO::MH_OBJECT)<br>
{<br>
    // Read symbol table from memory<br>
}<br>
else<br>
{<br>
    // read symbol table using load commands<br>
}<br>
</blockquote></div><br></div>