[LLVMdev] Boehm GC + static variables?

James Williams junk at giantblob.com
Sun Jan 31 04:53:56 PST 2010


Hi,

I'm running LLVM bitcode generated by my compiler under lli. The bitcode is
linked against Boehm GC (lli -load=/usr/lib/libgc.so).

It looks like Boehm GC isn't scanning global variables and as a result
objects referenced only through globals are being prematurely collected. I
understand that Boehm GC needs to see the data segment containing my global
variables as a root. For native executables It's smart enough to pick this
up from the sections in the ELF executable but this doesn't apply when LLVM
bitcode is running under lli.

Is there some way I can hook into the code generator's placement of new data
segments as bitcode is compiled to native code so I can add roots for the
segments as required by Boehm GC?

Thanks in advance,
-- James Williams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100131/994aa001/attachment.html>


More information about the llvm-dev mailing list