[LLVMdev] Linkage question

Reid Kleckner 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):
>>        -rdynamic
>>            Pass the flag -export-dynamic to the ELF linker, on targets
>> that
>>            support it. This instructs the linker to add all symbols, not
>> only
>>            used ones, to the dynamic symbol table. This option is needed
>> for
>>            some uses of "dlopen" or to allow obtaining backtraces from
>> within
>>            a program.
>> - D.
> HI
> 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...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130313/b0c2161b/attachment.html>

More information about the llvm-dev mailing list