[LLVMdev] Linkage question
rnk at google.com
Wed Mar 13 08:15:03 PDT 2013
On Wed, Mar 13, 2013 at 10:41 AM, Vania Joloboff <vania.joloboff at inria.fr>wrote:
> On 03/13/2013 11:01 AM, Dmitry Mikushin wrote:
>> Hi Vania,
>> If I understood correctly, you have an executable, which is JITing code
>> that has dependencies on the symbols of entire executable. In case dlsym
>> cannot find this symbol, try to link your executable with -rdynamic (gcc)
>> or --export-dynamic (ld):
>> Pass the flag -export-dynamic to the ELF linker, on targets
>> support it. This instructs the linker to add all symbols, not
>> used ones, to the dynamic symbol table. This option is needed
>> some uses of "dlopen" or to allow obtaining backtraces from
>> a program.
>> - D.
> Yes may be it'll work with export dynamic, but then it will export too
> many symbols.
> Can we control the link resolution from the LLVM execution engine ?
Maybe. You can also annotate all the symbols you intend to use in the
JITed code with __attribute__((visibility("default"))), which will make
them visible to dlsym().
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev