Skip to content

Commit 36fd2b5

Browse files
committed
Fixes.
1 parent cacaaf2 commit 36fd2b5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/graal/snippets/CEntryPointSnippets.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
import com.oracle.svm.core.imagelayer.ImageLayerSection;
8888
import com.oracle.svm.core.jdk.PlatformNativeLibrarySupport;
8989
import com.oracle.svm.core.jdk.RuntimeSupport;
90+
import com.oracle.svm.core.layeredimagesingleton.MultiLayeredImageSingleton;
9091
import com.oracle.svm.core.log.Log;
9192
import com.oracle.svm.core.option.RuntimeOptionParser;
9293
import com.oracle.svm.core.os.CommittedMemoryProvider;
@@ -216,7 +217,7 @@ private static void initCodeBase() {
216217
int codeStartEntry = ImageLayerSection.getEntryOffset(ImageLayerSection.SectionEntries.CODE_START);
217218
codeBase = initialLayerSection.readWord(codeStartEntry);
218219
} else {
219-
ImageCodeInfo imageCodeInfo = ImageSingletons.lookup(ImageCodeInfo.class);
220+
ImageCodeInfo imageCodeInfo = MultiLayeredImageSingleton.getForLayer(ImageCodeInfo.class, MultiLayeredImageSingleton.INITIAL_LAYER_NUMBER);
220221
codeBase = imageCodeInfo.getCodeStart();
221222
}
222223
writeCurrentVMCodeBase(codeBase);

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image/NativeImageHeapWriter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,8 @@ private void writeConstant(RelocatableBuffer buffer, int index, JavaKind kind, O
268268
if (!(method instanceof HostedMethod)) {
269269
method = metaAccess.getUniverse().lookup(method);
270270
}
271-
if (NativeImage.isInjectedNotCompiled((HostedMethod) method)) {
271+
if (imageLayer && NativeImage.isInjectedNotCompiled((HostedMethod) method)) {
272+
// Will be patched in a future layer (even if it ends up not being compiled at all)
272273
addWordConstantRelocation(buffer, index, methodOffset);
273274
return;
274275
}

0 commit comments

Comments
 (0)