Add support for data imports.

This commit is contained in:
James Benton 2019-10-02 18:29:41 +01:00
parent f1b7a8f517
commit 4603bdb986

View File

@ -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;