<div dir="ltr"><span style="font-size:12.8px">Hey Paul,</span><div style="font-size:12.8px">first of all thank you for taking the time to answer me,</div><div style="font-size:12.8px">if I understand you correctly, I need to modify the instruction it self so one of it's operands is a symbol, and then at MC layer handle that symbol and add an entry to the symtab for that label?</div><div style="font-size:12.8px">What kind of symbol should I use doing such thing? external symbol or MCSymbol?</div><div style="font-size:12.8px">I was trying to find where in the code during the MC layer I add entries to the symtab, I'd really appreciate some directions in the area.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Let me give an example so my questions might be a bit more clearer:</div><div style="font-size:12.8px">BB#0</div><div style="font-size:12.8px">...some opcodes...</div><div style="font-size:12.8px">mov r1, BB#1</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">BB#1</div><div style="font-size:12.8px">...some opcodes...</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">I'd like to put a place holder instead of the BB#1 in the mov opcode, and create a symbol named "BB#1" that points to that opcode, so during link time I can replace that placeholder with the actual address of BB#1.</div><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">Again thank you for your time and answer,</div><div style="font-size:12.8px">Liad.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 14, 2017 at 9:03 PM, Robinson, Paul <span dir="ltr"><<a href="mailto:paul.robinson@sony.com" target="_blank">paul.robinson@sony.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div class="m_-332612994014142287WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">The .symtab has symbols; you could define a label for the instruction, and store something in the symbol table entry for the label.  This kind of thing would
 be done in the MC layer.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">This would be one way to provide annotations that aren't needed for execution.  If you need to change the instruction itself, for example to have the instruction
 refer to memory somewhere, then you need to modify the instruction itself.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d">--paulr<u></u><u></u></span></p>
<p class="MsoNormal"><a name="m_-332612994014142287__MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d"><u></u> <u></u></span></a></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> llvm-dev [mailto:<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@<wbr>lists.llvm.org</a>]
<b>On Behalf Of </b>Liad Mordekoviz via llvm-dev<br>
<b>Sent:</b> Thursday, December 14, 2017 2:37 AM<br>
<b>To:</b> llvm-dev<br>
<b>Subject:</b> [llvm-dev] Help adding entries to .symtab<u></u><u></u></span></p>
</div>
</div><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi everyone,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I am fairly new to LLVM, I'm working on a new backend.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I am trying to add information to a specific instruction using the .symtab in the ELF format.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I've been searching through the LLVM source code trying to find a way to do such a thing.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Can anyone help me with some directions or point me to some documents in the matter.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks, Liad.<u></u><u></u></p>
</div>
</div>
</div></div></div>
</div>
</div>

</blockquote></div><br></div>