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
bootstrap_thunk_chunk* chunk = new (pbChunk) bootstrap_thunk_chunk(numThunks, (pal::dll_t)pe.GetBase());
@janvorli:
Since the host cannot use coreclr PAL or coreclr itself, we’ll need to have a separate implementation of the necessary stuff for it. It seems that the thunks are just created at the initialization time and never changed again. We could possibly just allocate the block of thunks with page granularity as RW and then switch them to RX after they are initialized. But we would waste part of the last page allocated for the thunks. An outstanding question is, how many of these thunks we have and whether the waste would be significant. Perhaps we could reuse the coreclr minipal in the host and use the double mapping implementation. Since the minipal is a native piece of code that uses standard platform headers / libraries, it seems it would work too.
@jkoritzinsky:
We create an executable heap with this code
runtime/src/native/corehost/ijwhost/ijwhost.cpp
Line 117 in c1b153a
and then write to the data on that heap here:
runtime/src/native/corehost/ijwhost/ijwthunk.cpp
Line 62 in c1b153a
@janvorli:
Since the host cannot use coreclr PAL or coreclr itself, we’ll need to have a separate implementation of the necessary stuff for it. It seems that the thunks are just created at the initialization time and never changed again. We could possibly just allocate the block of thunks with page granularity as RW and then switch them to RX after they are initialized. But we would waste part of the last page allocated for the thunks. An outstanding question is, how many of these thunks we have and whether the waste would be significant. Perhaps we could reuse the coreclr minipal in the host and use the double mapping implementation. Since the minipal is a native piece of code that uses standard platform headers / libraries, it seems it would work too.
Related: #50391 and #69672
/cc @dotnet/interop-contrib
The text was updated successfully, but these errors were encountered: