[llvm-dev] Broken relocation for generating offsets?
Reid Kleckner via llvm-dev
llvm-dev at lists.llvm.org
Thu Mar 22 10:43:12 PDT 2018
I wouldn't be surprised if JITing COFF files on Windows doesn't work so
well, since the object file format assumes most symbols are dllimport or
within the local 2GB module address range.
I'm not familiar with the current JIT state of the art, though.
On Thu, Mar 22, 2018 at 1:45 AM via llvm-dev <llvm-dev at lists.llvm.org>
wrote:
> Hello,
>
> I append another clue I found out: The problem is definitely not caused by
> "__ImageBase" the problem comes with the "OFFSET". I generated another
> object file which crashed. The commonality:
> mov edx, DWORD PTR ?normalPlanschbecken@@3HA ; normalPlanschbecken
> lea rcx, *OFFSET FLAT*:??_C at _0CC@LCMJAIPO
> @Reading?5?$CCnormalPlanschbecken?$CC?5?$CFi@
> jmp printf
>
>
>
>
> From: via llvm-dev <llvm-dev at lists.llvm.org>
> To: llvm-dev at lists.llvm.org
> Date: 06.03.2018 10:45
> Subject: [llvm-dev] Broken relocation for generating offsets?
> Sent by: "llvm-dev" <llvm-dev-bounces at lists.llvm.org>
> ------------------------------
>
>
>
> Hello LLVM-Mailing-List,
>
> I discovered a strange behavior when dealing with object files generated
> by the compiler of Visual Studio 2015.
>
> 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.
> mov eax, DWORD PTR ?myInt@@3HA ; myInt
> lea rdi,* OFFSET FLAT*:__ImageBase
> xor ebx, ebx
>
>
>
> Then these offset is used to jump to some labels like "$LL4 at execute:".
>
> 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?
>
> Kind regards
> Björn
>
> Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,
> USt.ID-Nr. DE 114 165 789
> Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode,
> Heiko Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> *http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev*
> <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
>
>
>
> Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,
> USt.ID-Nr. DE 114 165 789
> Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode,
> Heiko Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.
>
>
>
> Als GmbH eingetragen im Handelsregister Bad Homburg v.d.H. HRB 9816,
> USt.ID-Nr. DE 114 165 789
> Geschäftsführer: Dr. Hiroshi Nakamura, Dr. Robert Plank, Markus Bode,
> Heiko Lampert, Hiroshi Kawamura, Takashi Nagano, Takeshi Fukushima.
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180322/d28992c1/attachment.html>
More information about the llvm-dev
mailing list