<div dir="ltr">Hi Dimitar,<div><br></div><div>This is pretty weird that createObjectFile() doesn't work. What errors do you observe? You may take a look at a various LLVM commandline tools that walk the symbol table of the file for inspiration.</div>
<div>See tools/llvm-nm/llvm-nm.cpp for example. (it uses createBinary()) function.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 22, 2014 at 11:09 AM, Dimitar Dobrev <span dir="ltr"><<a href="mailto:dpldobrev@yahoo.com" target="_blank">dpldobrev@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:12pt">
<br>    Hello all,<br><br>    I develop <a href="https://github.com/mono/CppSharp" target="_blank">a project based on Clang</a> where I need to read all symbols from a library. For symbols libraries (.a/.lib) I use the following code:<br>
<br>    auto &FM = C->getFileManager();<br>    ...<br>    auto Buffer = FM.getBufferForFile(FileEntry);<br>    ...<br>    auto Object = llvm::object::ObjectFile::createObjectFile(Buffer);<br><br>    This code crashes at the last line if the file in question is a shared object (.so).
 Apparently I need to use different code to parse a shared object but I have little idea what. Any help will be appreciated.<br><br>    Thank you for your time,<br>    Dimitar Dobrev<br><br><div><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:12pt">
<div><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:12pt"><div></div></div></div></div></div></div></div></div></div><br>_______________________________________________<br>

LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div>
</div>