Hi everyone,<div><br></div><div>I'm working on a project where I need to add the addresses's of specific instructions to the DWARF output.</div><div><br></div><div>I've been digging around for the last week or so trying to figure out exactly what I need to do, but this is my first list posting.</div>
<div><br></div><div>I came across this posting: <a href="http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-September/034464.html">http://lists.cs.uiuc.edu/pipermail/llvmdev/2010-September/034464.html</a></div><div>which seems to be doing almost exactly what I want to do, however it was created with LLVM 2.7 in mind.  Since then, from what I can tell, the LLVM MC project has been created and blown away the usefulness of the descriptions contained in that thread. (Example: AsmPrinter::processDebugLoc() no longer exists).  Does anyone have any pointers on how to update this for LLVM/clang 3.0?</div>
<div><br></div><div>To be more specific, I've added a special stack guard intrinsic similar to StackProtector.cpp which uses a per function random immediate instead of ___stack_chk_guard.  What I am trying to accomplish is to get the offset into the final x86 object file of each one of these immediate values.</div>
<div><br></div><div>An example of the output in Assembly looks like:</div><div>movq<span class="Apple-tab-span" style="white-space:pre">  </span>$653406579, -8(%rbp)    ## imm = 0x26F23173</div><div><br></div><div>In reality, I'd settle for a simple way to get the offset into the Obj file of the movq instruction that I could putput to a separate file, but It'd be better if I could get it into the DWARF tags.</div>
<div><br></div><div>Does anyone have any familiarity with this to give me some pointers?</div><div><br></div><div>Thanks,</div><div>AK</div>