[PATCH] D30709: Handle IMAGE_REL_AMD64_ADDR32NB in RuntimeDyldCOFF

Janosch via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 22 05:54:37 PST 2018


LepelTsmok added a comment.

Hello marsupial,

I know that this revision is closed - but I have a question related to your changes.
I'm using your code for a while now - but there is one behavior I don't understand. I used Visual Studio to generate an object file. The visual studio compiler generated a real strange code, which makes a switch case depending on "__ImageBase".
However - I use the ExecutionEngine to jit an empty bitcode file, while adding the mentioned object file to the process. Without your code, the execution of the switch case crashes the application. But with your code things are getting interessting. When the ExecutionEngine tries to resolve "__ImageBase" I did the same thing as you: gave him the lowest address of my sections. CRASH! So I decided - just for fun - to gave him the address of a function. Using your code, that function will get called! That is not happening without your code. Also! When I add this object file to the JIT-Process, then exceptions won't work anymore.

I now wonder, if there is a way, that "__ImageBase" won't get resolved by "me" but by your code in the "RuntimeDyldCOFFX86_64.h" file - then everything would be identical and maybe could work.

I would be really happy if I get a response to this and I try my best to explain the situation.


Repository:
  rL LLVM

https://reviews.llvm.org/D30709





More information about the llvm-commits mailing list