[LLVMdev] Whole Program Analysis with dynamically loaded libraries

John Criswell jtcriswel at gmail.com
Sun May 31 08:31:24 PDT 2015


On 5/28/15 9:41 PM, rohit bhatia wrote:
> Hi
>
> I was wondering if there is any way we can run whole program analysis 
> on more than just one compilation unit. I would like to include the 
> dynamically loaded libraries into the call graph too.
> Is there a way to do that?

Yes, you can do whole program analysis with LLVM.  You can either a) 
link the bitcode files of each compilation unit together with llvm-link 
and then use opt to run your pass(es) on the whole-program bitcode file; 
or b) Modify the LLVM Gold plugin to run your pass. The former is easier 
to do; the latter will make it easier to use your pass(es) on large 
open-source projects.

For dynamically loaded libraries, you will need to compile their source 
code to LLVM bitcode and link their bitcode files statically into the 
program.  Alternatively (though this is unlikely to work), you could use 
a tool like RevGen to translate their the library native code into LLVM IR.

Regards,

John Criswell

>
> Thanks and Regards
> Rohit
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
http://www.cs.rochester.edu/u/criswell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150531/c17b07e0/attachment.html>


More information about the llvm-dev mailing list