<div dir="ltr">Hi Bjoern,<div><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Could you please tell me, if there is a way to allocate the memory for the codemodules more precise? I would like to allocate the memory for strings from a separated memory-pool. But how can I detect a string? The only moment I can do this is in "notifyObjectLoaded" via the names of the symbols. But than it is impossible for my to get the address of the symbols. I noticed that some strings are stored in .rdata, but this is no guarantee. </blockquote></div><div><br></div><div>There is no easy way to do this at the moment, any it will always be limited by what the object format allows (as you said: you need the object format to tell you what's a string and what isn't, and they don't do that in all situations).</div><div><br></div><div>If you can identify strings at the IR level you could do this by allocating the strings in your own memory and marking the IR definitions as weak, but this would also require LLVM to be more careful about picking strong definitions, so it would require some non-trivial LLVM improvements. These improvements are on the drawing board, but there is no schedule for them to be implemented yet.</div><div><br></div><div>Cheers,</div><div>Lang.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 17, 2017 at 7:03 AM,  <span dir="ltr"><<a href="mailto:bjoern.gaier@horiba.com" target="_blank">bjoern.gaier@horiba.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><font size="2" face="sans-serif">Hi Lang,</font>
<br>
<br><font size="2" face="sans-serif">I'm using Windows. I was parsing an
IR-File and added the Module to the ExectuionEngine. If I than searched
for a function, I just got 0. But when the module had a main, I got an
address. I solved the problem via a call to "</font><font size="1" face="}">generateCodeForModule</font><font size="2" face="sans-serif">".
The JIT didn't even called my SymbolResolver in this special case.</font>
<br>
<br><font size="2" face="sans-serif">Could you please tell me, if there is
a way to allocate the memory for the codemodules more precise? I would
like to allocate the memory for strings from a separated memory-pool. But
how can I detect a string? The only moment I can do this is in "</font><font size="1" face="}">notifyObjectLoaded</font><font size="2" face="sans-serif">"
via the names of the symbols. But than it is impossible for my to get the
address of the symbols. I noticed that some strings are stored in .rdata,
but this is no guarantee.</font>
<br>
<br><font size="2" face="sans-serif">Kind regards</font>
<br><font size="2" face="sans-serif">Björn</font>
<br>
<br>
<br>
<br><font size="1" color="#5f5f5f" face="sans-serif">From:      
 </font><font size="1" face="sans-serif">Lang Hames <<a href="mailto:lhames@gmail.com" target="_blank">lhames@gmail.com</a>></font>
<br><font size="1" color="#5f5f5f" face="sans-serif">To:      
 </font><font size="1" face="sans-serif"><a href="mailto:bjoern.gaier@horiba.com" target="_blank">bjoern.gaier@horiba.com</a></font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Cc:      
 </font><font size="1" face="sans-serif">Clang Dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>>,
LLVM Developers Mailing List <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Date:      
 </font><font size="1" face="sans-serif">16.05.2017 18:37</font>
<br><font size="1" color="#5f5f5f" face="sans-serif">Subject:    
   </font><font size="1" face="sans-serif">Re: JIT - Resolve
obj file without a main</font>
<br>
<hr noshade><div class="HOEnZb"><div class="h5">
<br>
<br>
<br><font size="3">Hi Björn,</font>
<br>
<br><font size="3">I don't recall ever seeing this behavior before. Can you
describe the situation in more detail?</font>
<br>
<br><font size="3">Is this specifically for object files loaded via RTDyldLinkingLayer::<wbr>addObjectSet,
or does it apply to IR Modules without a main too?</font>
<br>
<br><font size="3">When you say the JIT won't resolve an address, do you
mean that you can't find anything when you call findSymbol on the JIT,
or that the JIT isn't calling your SymbolResolver back to find addresses?</font>
<br>
<br><font size="3">Was this for MacOS, Linux, or Windows?</font>
<br>
<br><font size="3">Cheers,</font>
<br><font size="3">Lang. </font>
<br>
<br><font size="3">On Fri, May 12, 2017 at 6:47 AM, <</font><a href="mailto:bjoern.gaier@horiba.com" target="_blank"><font size="3" color="blue"><u>bjoern.gaier@horiba.com</u></font></a><font size="3">>
wrote:</font>
<br><font size="2" face="sans-serif">Hello Lang,</font><font size="3"> <br>
</font><font size="2" face="sans-serif"><br>
I noticed, if I load a obj-File without a main-function, the Jitter won't
resolve any address. But if I have a main, everything works fine. Why is
this so? Is there a way to stop this?</font><font size="3"> <br>
</font><font size="2" face="sans-serif"><br>
Kind regards</font><font size="3"> </font><font size="2" face="sans-serif"><br>
Björn<br>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr.
DE 114 165 789<br>
Geschäftsführer: Hiroshi Kawamura, Dr Hiroshi Nakamura, Markus Bode, Heiko
Lampert, Takashi Nagano, Takeshi Fukushima.</font>
<br>
<br>
<br><font size="2" face="sans-serif"><br>
Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816, USt.ID-Nr.
DE 114 165 789<br>
Geschäftsführer: Hiroshi Kawamura, Dr Hiroshi Nakamura, Markus Bode, Heiko
Lampert, Takashi Nagano, Takeshi Fukushima.</font></div></div></blockquote></div><br></div>