<div dir="ltr"><div><div><div>Hello,<br></div>I'm having a problem while accessing a global variable from a Module compiled by the MCJIT.<br></div><br></div><div>For context, I have two modules (namely A and B). <i>Module A</i> is compiled by clang, while <i>Module B </i>is compiled by the MCJIT.<br>

</div><div><br>In <i>Module A</i> I defined a global variable like this:<br><i>@A = common global [800 x [800 x double]] zeroinitializer, align 16</i><br><br></div><i>Module B</i>, references that global like this:<br><div>

<i>@A = external global [800 x [800 x double]]</i><br clear="all"><div><div><div><div><div><br></div><div>The problem that I have is that the MCJIT is not able to solve the symbol for @A. I get the following error:<br><br>

<div style="margin-left:40px"><i>LLVM ERROR: Program used external function 'A' which could not be resolved!</i><br></div> <br>As far as I know, the MCJIT by default uses dlsym to solve the symbols. I tried to get the address for <i>@A</i> using dlsym, but i get NULL.<br>

<br></div><div>After compiling <i>Module A</i>, I used llvm-nm to check the symbol table:<br><br><div style="margin-left:40px"><b>0000000000608540 B A</b><br>0000000000aea540 B B<br>0000000000fcc540 B C<br>00000000006081c8 d _DYNAMIC<br>

0000000000608480 d _GLOBAL_OFFSET_TABLE_<br>0000000000402460 R _IO_stdin_used<br>....<br></div><br></div><div>Any clues?<br><br></div><div>Thank you,<br></div><div>-- <br><div dir="ltr"><div><span style="color:rgb(102,102,102)"><font face="arial, helvetica, sans-serif">Juan Manuel Martinez Caamaño, </font><font face="arial, helvetica, sans-serif">MSc.<br>

</font></span><font face="arial, helvetica, sans-serif"><span style="color:rgb(102,102,102)"><font size="1">PhD. Student, IRMA - Université de Strasbourg</font></span><br></font></div></div>
</div></div></div></div></div></div></div>