<div dir="ltr">Not sure I'm entirely following - llvm-symbolizer can symbolize addresses in object files, I think, including applying/interacting with relocations - I don't think it involves any use of the Disassembler.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 28, 2022 at 1:41 PM Nikita Ermoshkin via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="margin:0px"><div style="margin:0px">Hi LLVM devs,</div><div style="margin:0px"><br></div><div style="margin:0px">In my experimental backend, I’d like to symbolize the disassembled ELF and object files generated by the backend, so that labels/function names are printed instead of just memory addresses. When using objdump. The simplest implementation I’ve found is the AMDGPU symbolizer in the Disassembler, which I mimicked. This works fine only in very specific cases, where the address in the operand exists in the section’s symbol table. However, if the symbol to reference is in another section, or if the operand value is just 0 with a fix-up/relocation, it obviously doesn’t give correct results. </div><div style="margin:0px"><br></div><div style="margin:0px">So the question: is there a more robust way to get access to all the symbols and relocation data in the target Disassembler? I haven’t fully dug through how x86 does it but it seems really complicated, and my much simpler backend probably doesn’t need that level of complexity. </div></div><br><div></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>