[LLVMdev] lli fine, compiled segfault?

ret val retval386 at gmail.com
Thu Sep 22 12:02:39 PDT 2011


The line that seems to be causing this is
        new StoreInst(store->getValueOperand(), shadow, &*i);

where
       store and i are Instructions, i being what I'm looping over
       shadow is a new GlobalVariable I created. I also made a new
section for it to be in.

Does this help any? I don't understand the significance of this line,
all looks fine to me still.

On Thu, Sep 22, 2011 at 12:42 PM, ret val <retval386 at gmail.com> wrote:
> I have a simple C test file I run a fairly simple Pass on. When I try
> to run the generated bitcode(after running the pass) with lli all is
> fine. When I try to compile this down to a actual elf executable I get
> a segfault.
>
>        clang -emit-llvm -S test1.c -o test1.bc
>        opt -load ~/llvm/Release+Asserts/lib/LLVMHello.so -hello < test1.bc >
> test1_pass.bc
>        lli test1_pass.bc # All is fine
>        llc test1_pass.bc -o test1_pass.s
>        gcc test1_pass.s -o test1_pass.elf
>        ./test1_pass.elf # SEGFAULT
>
> I'm I compiling this wrong? I'm not sure how else I could get a error
> with this or what could be wrong with my current method
>
> Thanks
>




More information about the llvm-dev mailing list