You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix RhpCallCatchFunclet .text relocation on amd64. (#111227)
c8e4f2c
changed asm implementation in RhpThrowHwEx on amd64 from a relative
jump, using jmp RhpThrowHwEx to a mov rax, RhpThrowHwEx that is later
jumped to using jmp rax.
This introduce a ADDR64 relocation record in the generated object file:
000004EC ADDR64 00000000 00000000 2A RhpThrowHwEx
That will then be left as a relocation that needs to be fixed up
by the loader:
73000 RVA, C SizeOfBlock
F7C DIR64 0000000140073A90 RhpThrowHwEx
0 ABS
Where the RVA 73000 is part of the .text section that is read, execute
section.
Having relocations done to the .text section is however not supported on
all Windows platform configurations leading to loader errors
blocking use of nativeaot on these configurations.
This commit change the mov to a lea instruction using relative offset
to calculate address of RhpThrowHwEx. That will end up with a REL32
relocation record in the generated object file:
000004ED REL32 00000000 2A RhpThrowHwEx
Since this uses relative addressing it won't leave any
relocation in the final image making sure the generated nativeaot image
can be successfully loaded on Windows platforms with configurations
preventing relocation in .text section.
0 commit comments