<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi Björn<br>
<br>
I am not aware of any symbol query issue that depends on the
presence of a main function. However, if you call
IRCompileLayer::findSymbol(const std::string &Name, bool
ExportedSymbolsOnly) you should make sure to pass "false" as the
second argument if you are running on Windows.<br>
<br>
If you look for a working demo on Windows, that may be interesting
for you (incl. a step-by-step guide in branches):<br>
<a class="moz-txt-link-freetext" href="https://github.com/weliveindetail/JitFromScratch">https://github.com/weliveindetail/JitFromScratch</a><br>
<br>
Cheers<br>
Stefan<br>
</p>
<p>Am 29.05.17 um 09:08 schrieb via llvm-dev:<br>
</p>
<blockquote
cite="mid:OF4B96EF7C.3A3DA8FB-ONC125812F.0026FE9C-C125812F.002734E9@smtpgw.horiba.co.jp"
type="cite"><font face="sans-serif" size="2">Hello Lang,</font>
<br>
<br>
<font face="sans-serif" size="2">so you are part of the
"Jitter-Team"?</font>
<br>
<font face="sans-serif" size="2">I'm really interested in this
whole
jitting-process. I wanted to know, is there a way to load other
obj-files,
than the one created with clang? Could I load - for example - a
obj-File
from VisualStudio? Or will the namemangeling fail?</font>
<br>
<br>
<font face="sans-serif" size="2">Kind regards</font>
<br>
<font face="sans-serif" size="2">Björn</font>
<br>
<br>
<br>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">From:
</font><font face="sans-serif" size="1">Lang Hames
<a class="moz-txt-link-rfc2396E" href="mailto:lhames@gmail.com"><lhames@gmail.com></a></font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">To:
</font><font face="sans-serif" size="1"><a class="moz-txt-link-abbreviated" href="mailto:bjoern.gaier@horiba.com">bjoern.gaier@horiba.com</a></font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Cc:
</font><font face="sans-serif" size="1">Clang Dev
<a class="moz-txt-link-rfc2396E" href="mailto:cfe-dev@lists.llvm.org"><cfe-dev@lists.llvm.org></a>,
LLVM Developers Mailing List <a class="moz-txt-link-rfc2396E" href="mailto:llvm-dev@lists.llvm.org"><llvm-dev@lists.llvm.org></a></font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Date:
</font><font face="sans-serif" size="1">24.05.2017 01:19</font>
<br>
<font color="#5f5f5f" face="sans-serif" size="1">Subject:
</font><font face="sans-serif" size="1">Re: JIT - Resolve
obj file without a main</font>
<br>
<hr noshade="noshade">
<br>
<br>
<br>
<font size="3">Hi Bjoern,</font>
<br>
<br>
<font size="3">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. </font>
<br>
<br>
<font size="3">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).</font>
<br>
<br>
<font size="3">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.</font>
<br>
<br>
<font size="3">Cheers,</font>
<br>
<font size="3">Lang.</font>
<br>
<br>
<font size="3">On Wed, May 17, 2017 at 7:03 AM, <</font><a
moz-do-not-send="true" href="mailto:bjoern.gaier@horiba.com"
target="_blank"><font color="blue" size="3"><u>bjoern.gaier@horiba.com</u></font></a><font
size="3">>
wrote:</font>
<br>
<font face="sans-serif" size="2">Hi Lang,</font><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
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">generateCodeForModule</font><font
face="sans-serif" size="2">".
The JIT didn't even called my SymbolResolver in this special
case.</font><font size="3">
<br>
</font><font face="sans-serif" size="2"><br>
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">notifyObjectLoaded</font><font
face="sans-serif" size="2">"
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><font size="3"> <br>
</font><font face="sans-serif" size="2"><br>
Kind regards</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
Björn</font><font size="3"> <br>
<br>
<br>
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
From: </font><font face="sans-serif" size="1">Lang
Hames <</font><a moz-do-not-send="true"
href="mailto:lhames@gmail.com" target="_blank"><font
color="blue" face="sans-serif" size="1"><u>lhames@gmail.com</u></font></a><font
face="sans-serif" size="1">></font><font size="3">
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
To: </font><a moz-do-not-send="true"
href="mailto:bjoern.gaier@horiba.com" target="_blank"><font
color="blue" face="sans-serif" size="1"><u>bjoern.gaier@horiba.com</u></font></a><font
size="3">
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
Cc: </font><font face="sans-serif" size="1">Clang
Dev <</font><a moz-do-not-send="true"
href="mailto:cfe-dev@lists.llvm.org" target="_blank"><font
color="blue" face="sans-serif" size="1"><u>cfe-dev@lists.llvm.org</u></font></a><font
face="sans-serif" size="1">>,
LLVM Developers Mailing List <</font><a
moz-do-not-send="true" href="mailto:llvm-dev@lists.llvm.org"
target="_blank"><font color="blue" face="sans-serif" size="1"><u>llvm-dev@lists.llvm.org</u></font></a><font
face="sans-serif" size="1">></font><font size="3">
</font><font color="#5f5f5f" face="sans-serif" size="1"><br>
Date: </font><font face="sans-serif" size="1">16.05.2017
18:37</font><font size="3"> </font><font color="#5f5f5f"
face="sans-serif" size="1"><br>
Subject: </font><font face="sans-serif" size="1">Re:
JIT - Resolve obj file without a main</font><font size="3"> <br>
</font>
<hr noshade="noshade">
<br>
<font size="3"><br>
<br>
<br>
Hi Björn, <br>
<br>
I don't recall ever seeing this behavior before. Can you
describe the situation
in more detail? <br>
<br>
Is this specifically for object files loaded via
RTDyldLinkingLayer::addObjectSet,
or does it apply to IR Modules without a main too? <br>
<br>
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? <br>
<br>
Was this for MacOS, Linux, or Windows? <br>
<br>
Cheers, <br>
Lang. <br>
<br>
On Fri, May 12, 2017 at 6:47 AM, <</font><a
moz-do-not-send="true" href="mailto:bjoern.gaier@horiba.com"
target="_blank"><font color="blue" size="3"><u>bjoern.gaier@horiba.com</u></font></a><font
size="3">>
wrote: </font><font face="sans-serif" size="2"><br>
Hello Lang,</font><font size="3"> </font><font
face="sans-serif" size="2"><br>
<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"> </font><font
face="sans-serif" size="2"><br>
<br>
Kind regards</font><font size="3"> </font><font
face="sans-serif" size="2"><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><font size="3">
<br>
<br>
</font><font face="sans-serif" size="2"><br>
<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 face="sans-serif" size="2"><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>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="https://about.me/stefan.graenitz">https://about.me/stefan.graenitz</a>
<a class="moz-txt-link-freetext" href="https://cryptup.org/pub/stefan.graenitz@gmail.com">https://cryptup.org/pub/stefan.graenitz@gmail.com</a></pre>
</body>
</html>