Skip to content

linker: Initial Windows C++ exception unwinding support

Tamar Christina requested to merge Phyx/ghc:wip/T20918-cpp-exceptions into master

Adds C++ exception unwinding support to the Windows Runtime Linker

Also fixes a relocation we've been resolving incorrectly. We were treating IMAGE_REL_AMD64_ADDR32NB the same as R_X86_64_32S in ELF, however this isn't correct. R_X86_64_32S indicates the relocation should silently truncate to a 32-bit address, whereas IMAGE_REL_AMD64_ADDR32NB indicates the address should resolve to a 32-bit relative to the ImageBase address.

IMAGE_REL_AMD64_ADDR32NB is typically used to pass a relative address to an external function. It's commonly used to pass unwind information to the system unwinder and is why I've noticed the wrong value now.

Also fixes a small issue in the testsuite where string literals weren't being properly escaped causing the testsuite not to run when using a native python3 on Windows.

Fixes #20918 (closed)

Edited by Tamar Christina

Merge request reports