summaryrefslogtreecommitdiff
path: root/src/vm/amd64
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2016-02-01 17:15:37 +0100
committerJan Vorlicek <janvorli@microsoft.com>2016-02-01 22:00:29 +0100
commit63160ef45ea92a3105e8854c69318985b63d34d5 (patch)
tree545e3f8f8e5f8c949c888a41bb954035dab3bab2 /src/vm/amd64
parente3d17312531d35e52cef1158932be6717029b161 (diff)
downloadcoreclr-63160ef45ea92a3105e8854c69318985b63d34d5.tar.gz
coreclr-63160ef45ea92a3105e8854c69318985b63d34d5.tar.bz2
coreclr-63160ef45ea92a3105e8854c69318985b63d34d5.zip
Fix ReadyToRun on Unix
While making the ready to run tests run on Unix, I have discovered that the feature doesn't really work on Unix. First, I have found that the test was generating the native images into the NI subfolder, but the corerun on Unix doesn't use this notation and expects these images to live side by side with the IL executables. So, the test to verify that an image cannot be loaded multiple times was failing, since the main exe loaded the IL test.dll instead of the native one and so explicit load of the native test.dll wasn't considered a secondary load of the same image. After fixing the test, I have found that attempt to load a ready to run image is failing with an assert. There were these issues: - the loaded native image was not marked as relocated - the EPILOG_WITH_TRANSITION_BLOCK_RETURN macro was missing popping argument registers - One of the asserts and one getter didn't take into account the fact that the ready to run native image is not considered to have native header. - The assembler helpers DelayLoad_Helper and DelayLoad_MethodCall were passing a hex number as a parameter to the PROLOG_WITH_TRANSITION_BLOCK, but it was using the "h" suffix notation. There is a known issue in the clang assembler which causes such suffix to be swallowed so the macro was getting just "10" instead of "10h". The fix was to use 0x prefix instead. This change fixes the problem. The ready to run tests pass with it correctly.
Diffstat (limited to 'src/vm/amd64')
-rw-r--r--src/vm/amd64/externalmethodfixupthunk.S4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vm/amd64/externalmethodfixupthunk.S b/src/vm/amd64/externalmethodfixupthunk.S
index aad01bf0e2..b5c3780671 100644
--- a/src/vm/amd64/externalmethodfixupthunk.S
+++ b/src/vm/amd64/externalmethodfixupthunk.S
@@ -30,7 +30,7 @@ NESTED_END ExternalMethodFixupStub, _TEXT
NESTED_ENTRY DelayLoad_MethodCall, _TEXT, NoHandler
- PROLOG_WITH_TRANSITION_BLOCK 0, 10h, rdx, rcx, 0
+ PROLOG_WITH_TRANSITION_BLOCK 0, 0x10, rdx, rcx, 0
lea rdi, [rsp + __PWTB_TransitionBlock] // pTransitionBlock
mov rsi, rax // pIndirection
@@ -50,7 +50,7 @@ NESTED_END DelayLoad_MethodCall, _TEXT
NESTED_ENTRY DelayLoad_Helper\suffix, _TEXT, NoHandler
- PROLOG_WITH_TRANSITION_BLOCK 0, 10h, rdx, rcx, 0
+ PROLOG_WITH_TRANSITION_BLOCK 0, 0x10, rdx, rcx, 0
mov r8, \frameFlags
lea rdi, [rsp + __PWTB_TransitionBlock] // pTransitionBlock