lli fine, compiled segfault?

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 >
  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


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

       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.