[PATCH] D30709: Handle IMAGE_REL_AMD64_ADDR32NB in RuntimeDyldCOFF

Janosch via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 25 02:32:45 PST 2018


LepelTsmok added a comment.

> It's a little hard to understand the issue.

I'm sorry! I try my best >o<

> This patch is fixing an instance that used to crash?

Yes! Your patch helped me to make exceptions run from my JITed code

> Lastly you had exceptions working between JITed and Non-Jited code in Windows without this patch?

No! Never!

> Have you looked at setting __ImageBase via RuntimeDyld::mapSectionAddress or DynamicLibrary::AddSymbol
>  The later would probably require a custom SectionAllocator that pre-allocated so you know the base address before relocation occurs.

Haven't tried this yet

> Loading an object file that uses __ImageBase might be problematic as the other compiler may be generating sections that the JIT will later discard.
>  This would make all relocation offsets relative to it incorrect later.

The strange case is, that this situation never worked.

1. Case:

I'm running the LLVM without your patch. The object file from Visual Studio gets loaded and I call a function from it. I resolved __ImageBase with a function.
-> Crash!

2. Case:

I'm running the LLVM with your patch and do the same.
-> The function (I used to overload __ImageBase) gets called and the application crashes.

I can provide you the object file or source code which generates this specific code. Also I can provide the mixed assembly file I could even record my screen to show what I do.


Repository:
  rL LLVM

https://reviews.llvm.org/D30709





More information about the llvm-commits mailing list