<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: serif; background-color: transparent; font-style: normal;"><br><span class="tab">    Hello Alexey,</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: serif; background-color: transparent; font-style: normal;"><span class="tab"><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: serif; background-color: transparent; font-style: normal;"><span class="tab">    I did so a little after sending the e-mail (the tip is good nevertheless)</span>. I copied the relevant path in code and it worked fine. Thank you for your reply.<span class="tab"><br></span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div
 style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Tuesday, July 22, 2014 11:31 PM, Alexey Samsonov <vonosmas@gmail.com> wrote:<br> </font> </div>  <br><br> <div class="y_msg_container"><div id="yiv5453233746"><div><div dir="ltr">Hi Dimitar,<div><br clear="none"></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="yiv5453233746gmail_extra"><br clear="none"><br clear="none"><div class="yiv5453233746gmail_quote">On Tue, Jul 22, 2014 at 11:09 AM, Dimitar Dobrev <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:dpldobrev@yahoo.com" target="_blank" href="mailto:dpldobrev@yahoo.com">dpldobrev@yahoo.com</a>></span> wrote:<br clear="none">
<blockquote class="yiv5453233746gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="yiv5453233746yqt9711864702" id="yiv5453233746yqt39161"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">
<br clear="none">    Hello all,<br clear="none"><br clear="none">    I develop <a rel="nofollow" shape="rect" target="_blank" href="https://github.com/mono/CppSharp">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 clear="none">
<br clear="none">    auto &FM = C->getFileManager();<br clear="none">    ...<br clear="none">    auto Buffer = FM.getBufferForFile(FileEntry);<br clear="none">    ...<br clear="none">    auto Object = llvm::object::ObjectFile::createObjectFile(Buffer);<br clear="none"><br clear="none">    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 clear="none"><br clear="none">    Thank you for your time,<br clear="none">    Dimitar Dobrev<br clear="none"><br clear="none"><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></div><br clear="none">_______________________________________________<br clear="none">

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