GP-1160: MzLoader now populates relocation table

This commit is contained in:
Ryan Kurtz 2021-07-27 11:05:22 -04:00
parent 19fa121b30
commit 0640544b62

View File

@ -134,8 +134,8 @@ public class MzLoader extends AbstractLibrarySupportLoader {
}
monitor.setMessage("Setting registers...");
Symbol entrySymbol =
SymbolUtilities.getLabelOrFunctionSymbol(prog, ENTRY_NAME, err -> log.error("MZ", err));
Symbol entrySymbol = SymbolUtilities.getLabelOrFunctionSymbol(prog, ENTRY_NAME,
err -> log.appendMsg("MZ", err));
setRegisters(context, entrySymbol, memory.getBlocks(), dos);
}
@ -375,6 +375,11 @@ public class MzLoader extends AbstractLibrarySupportLoader {
int value = Conv.shortToInt(reader.readShort(locOffset));
int fixupAddrSeg = (value + csStart) & Conv.SHORT_MASK;
mem.setShort(fixupAddr, (short) fixupAddrSeg);
// Add to relocation table
prog.getRelocationTable()
.add(fixupAddr, 0, new long[] { off, seg }, converter.getBytes(value),
null);
}
}
catch (IOException e) {