Hi Brian, thanks for your reply.<div><br></div><div>My goal is to be able to extract from an assembly file (i.e. source compiled to assembly, directly) the static global vars declared in the source. So far I haven't found any API in the llvm asm parser to serve my purpose. Do you know if/ how I can accomplish that?<div><br></div><div>Thank you.<br><div><br><br>Il giorno sabato 6 febbraio 2021, Brian Cain <<a href="mailto:brian.cain@gmail.com">brian.cain@gmail.com</a>> ha scritto:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>You need to extract it from the source?  Is it possible to use the resulting object file instead?</div><div dir="auto"><br></div><div dir="auto">Note that there's no way to get an 'address' but you can get a section offset. The section offset for both code and data are available in the object file and from the assembler as it writes the object file.</div><div dir="auto"><br></div><div dir="auto">The contents of the assembly file - instructions and directives - contribute to the resulting layout.  The AsmParser can find tokens and build instructions but shouldn't know how it will get layed out.<br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sat, Feb 6, 2021, 3:16 AM Pietro D'Ettole via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>I'm a little bit stuck in code reading right now. Maybe some of you can help me to understand fast if what I need is feasible or not.</div><div>I was trying to understand if currently asm parser in llvm allows to easily extract from an asm file variable names alongside with their values and their addresses.</div><div><br></div><div>Thanks for the help!</div></div>
______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" rel="noreferrer" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer noreferrer" target="_blank">https://lists.llvm.org/cgi-<wbr>bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div></div>
</blockquote></div></div></div>