From 4603bdb986c976b264b588ea5043343cf884eaa4 Mon Sep 17 00:00:00 2001 From: James Benton Date: Wed, 2 Oct 2019 18:29:41 +0100 Subject: [PATCH] Add support for data imports. --- src/main/java/cafeloader/Cafe_ElfExtension.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/cafeloader/Cafe_ElfExtension.java b/src/main/java/cafeloader/Cafe_ElfExtension.java index 7e0e63c..5a7ad4d 100644 --- a/src/main/java/cafeloader/Cafe_ElfExtension.java +++ b/src/main/java/cafeloader/Cafe_ElfExtension.java @@ -79,13 +79,16 @@ public class Cafe_ElfExtension extends ElfExtension { } try { + Program program = elfLoadHelper.getProgram(); elfLoadHelper.setElfSymbolAddress(elfSymbol, address); elfLoadHelper.createSymbol(address, name, true, elfSymbol.isAbsolute(), null); if (elfSymbol.isFunction()) { - Program program = elfLoadHelper.getProgram(); program.getExternalManager().addExtFunction(rplName, name, address, SourceType.IMPORTED); + } else if (elfSymbol.isObject()) { + program.getExternalManager().addExtLocation(rplName, name, address, + SourceType.IMPORTED); } return null;