<font size=2 face="sans-serif">Hello LLVM-Mailing-List,</font>
<br>
<br><font size=2 face="sans-serif">I discovered a strange behavior when
dealing with object files generated by the compiler of Visual Studio 2015.</font>
<br>
<br><font size=2 face="sans-serif">When jitting bc files I also add object
files to look up functions. These object files are coming from visual studio.
When using a switch case instruction that compiler often generates code
based of __ImageBase. I show you a short snippet of the assembly output.</font>
<br>
<table width=100% style="border-collapse:collapse;">
<tr valign=top height=8>
<td width=100% style="border-style:solid solid solid solid;border-color:#000000;border-width:1px 1px 1px 1px;padding:0px 0px;"><font size=2 face="sans-serif">mov
        eax, DWORD PTR ?myInt@@3HA ; myInt</font>
<br><font size=2 face="sans-serif">lea        
rdi, OFFSET FLAT:__ImageBase</font>
<br><font size=2 face="sans-serif">xor        
ebx, ebx</font></table>
<br>
<br><font size=2 face="sans-serif">Then these offset is used to jump to
some labels like "$LL4@execute:".</font>
<br>
<br><font size=2 face="sans-serif">When the object file gets added to the
jitting process this offset generation seems to be broken. Executing the
code coming from the object file will lead to a crash. The crash address
will always be exactly the address I used to overload __ImageBase with.
So it seems that the address relocation is wrong with generating offsets?</font>
<br>
<br><font size=2 face="sans-serif">Kind regards</font>
<br><font size=2 face="sans-serif">Björn</font>
<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: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode, Heiko
Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.<br>
<br>
</font>