<div dir="ltr">Hi all,<br><br>I'm writing a GC plugin, targeting x86_64. I'm stuck on handling stack maps. I generate assembly for them like in the documentation: <a href="http://llvm.org/docs/GarbageCollection.html#emitting-assembly-code-gcmetadataprinter">http://llvm.org/docs/GarbageCollection.html#emitting-assembly-code-gcmetadataprinter</a> and now I'm trying to figure out the best way to correlate stack maps with call frames. <div>
<div>I have an idea to put a label before every stack map entry and then put the address of this label within well known offset from the function. Then, while walking the call stack and having function address I could retrieve relevant stack map entry..<br>
My current approach to generating the label for stack map entries looks like this:</div><div><div> <span class="" style="white-space:pre"> </span>MCSymbol *ala = AP.OutContext.GetOrCreateSymbol(StringRef("ala"));</div>
<div> <span class="" style="white-space:pre">  </span>OS.EmitLabel(ala);<br>But then, I don't know how to emit the address of the label near the function. I mean, I think I'd use something like this 'OS.EmitSymbolValue(ala, 4)', but I'm not sure where I should hook into to achieve this.<br>
<br>Note that I'm fairly new to LLVM and the approach I described above does not necessarily make much sense. I'd pleased to hear the proper way to handle stack maps.<br><br>Regards,<br>Paweł</div><br></div></div>
</div>