<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;"><br>
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
I was mistaken as to needing the virtual address of the section , but really need to know the virtual address of the beginning of the function that contains the label whose symbol expression we have.<br>
<div>
<div style="direction: ltr; font-family: Tahoma; color: rgb(0, 0, 0); font-size: 10pt;">
<br>
I have a case where I the expression (MCSymbolRefExpr) is the offset from the beginning of the function.<br>
<br>
<pre class="fragment">AsmPrinter::EmitJumpTableEntry() calls <a class="code" href="http://llvm.org/doxygen/classllvm_1_1MCStreamer.html#a3c0872c5c75608d870c0b6aaf0d206ed">EmitGPRel32Value()</a></pre>
<pre class="fragment">   <span class="keywordflow">case</span> <a class="code" href="http://llvm.org/doxygen/classllvm_1_1MachineJumpTableInfo.html#aaa21facdbb167f7c33d21907b8e5b9d3a0145ef8496d090993849ec0d7ca947f7">MachineJumpTableInfo::EK_GPRel32BlockAddress</a>: {<br>     <span class="comment">// EK_GPRel32BlockAddress - Each entry is an address of block, encoded</span><br>     <span class="comment">// with a relocation as gp-relative, e.g.:</span><br>     <span class="comment">//     .gprel32 LBB123</span><br>     <a class="code" href="http://llvm.org/doxygen/classllvm_1_1MCSymbol.html">MCSymbol</a> *MBBSym = MBB-><a class="code" href="http://llvm.org/doxygen/classllvm_1_1MachineBasicBlock.html#a24d0da534c4fb156547a04749b9f6468">getSymbol</a>();<br>     <a class="code" href="http://llvm.org/doxygen/classllvm_1_1AsmPrinter.html#a32ad5336c0020843cbb5a982c0f1a708">OutStreamer</a>.<a class="code" href="http://llvm.org/doxygen/classllvm_1_1MCStreamer.html#a3c0872c5c75608d870c0b6aaf0d206ed">EmitGPRel32Value</a>(<a class="code" href="http://llvm.org/doxygen/classllvm_1_1MCSymbolRefExpr.html#acfd4c9d4f462e858c577dc0f57ef2d30">MCSymbolRefExpr::Create</a>(MBBSym, <a class="code" href="http://llvm.org/doxygen/classllvm_1_1AsmPrinter.html#aa7625af893e242d33b9f182066f59310">OutContext</a>));<br><br>But can't in the process seem to lose the hook to the parent function. <br>It would seem that we need to add <a class="code" href="http://llvm.org/doxygen/classllvm_1_1MachineBasicBlock.html">MachineBasicBlock</a> *MBB to the call, but<br>if that isn't necessary would like to know how else to achieve the goal<br></pre>
<br>
Thanks,<br>
<br>
Jack<br>
</div>
</div>
</div>
</div>
</body>
</html>