Hi Alvin,

KLEE does a few extra tricks when linking. In particular, uclibc
defines its own entry point so KLEE rewrites the user's main function
to be called by this entry point. I think if you just link with
llvm-ld the wrong entry point will be called, and uclibc won't end up
being initialized.

 - Daniel

On Thu, Apr 15, 2010 at 8:55 PM, Alvin Cheung <akcheung at csail.mit.edu> wrote:
> Hello,
>
> I have been playing around with coreutils and uclibc from the klee tutorial. 
> ?I
> noticed that while the exe produced by klee-gcc can be run via lli, but when I
> manually linked in libc from the klee version of uclibc with the exe, the 
> output
> exe is no longer runnable (it segfaults). ?But I thought klee does the linking
> too when it initializes, so I am curious what's the difference between the
> linking done by klee and that done by llvm-ld, and why that linking must be 
> done
> via klee rather than providing klee with a linked exe?
>
> Thanks,
> Alvin
> _______________________________________________
> klee-dev mailing list
> klee-dev at keeda.stanford.edu
> http://keeda.Stanford.EDU/mailman/listinfo/klee-dev
>

Reply via email to