joker.eph added a comment. How could we integrate accesses to global variable as part of this? It turns out that to be able to benefit from the linker information on what symbol is exported during the import, this is a must. http://reviews.llvm.org/D17212