Skip to content

Commit d64fca5

Browse files
author
yetmorecode
committed
ghidra 12 changes, relocations support merged
1 parent 8bad5ad commit d64fca5

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

src/main/java/yetmorecode/ghidra/format/lx/datatype/ObjectFixupsType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public ObjectFixupsType(Executable executable, LinearObjectTableEntry object, Op
6262
var ref = new MemReferenceImpl(
6363
space.getAddress(f.getSourceAddress()),
6464
to,
65-
RefType.DATA_IND,
65+
RefType.DATA,
6666
SourceType.ANALYSIS,
6767
0,
6868
false

src/main/java/yetmorecode/ghidra/lx/LinearLoader.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import ghidra.program.model.data.DataType;
2222
import ghidra.program.model.data.StructureDataType;
2323
import ghidra.program.model.lang.LanguageCompilerSpecPair;
24-
import ghidra.program.model.listing.CodeUnit;
24+
import ghidra.program.model.listing.CommentType;
2525
import ghidra.program.model.listing.Data;
2626
import ghidra.program.model.listing.Program;
2727
import ghidra.program.model.reloc.Relocation;
@@ -56,6 +56,7 @@
5656
* @author yetmorecode@posteo.net
5757
*/
5858
public abstract class LinearLoader extends AbstractLibrarySupportLoader {
59+
5960
protected final static String CHECK = " " + (new String(new int[] { 0x2713 }, 0, 1)) + " ";
6061
protected final static String CLOCK = " " + (new String(new int[] { 0x231b }, 0, 1)) + " ";
6162
protected final static String HORSE = " " + (new String(new int[] { 0x2658 }, 0, 1)) + " ";
@@ -92,14 +93,14 @@ public Collection<LoadSpec> findSupportedLoadSpecs(ByteProvider provider) throws
9293
public abstract void onLoadSuccess(Program program);
9394

9495
@Override
95-
protected void load(ByteProvider provider, LoadSpec loadSpec, List<Option> options,
96-
Program program, TaskMonitor monitor, MessageLog log)
97-
throws CancelledException, IOException {
96+
protected void load(Program program, ImporterSettings settings) throws CancelledException, IOException {
97+
var monitor = settings.monitor();
98+
var provider = settings.provider();
9899

99100
if (monitor.isCancelled()) {
100101
return;
101102
}
102-
messageLog = log;
103+
messageLog = settings.log();
103104
messageLog.clear();
104105
log(CLOCK + "Loading '%s'", program.getDomainFile());
105106

@@ -535,7 +536,7 @@ private void createEntrypoint(Executable exe, Program program, TaskMonitor monit
535536
if (loaderOptions.createFixupLabels) {
536537
program.getListing().setComment(
537538
addr,
538-
CodeUnit.PRE_COMMENT,
539+
CommentType.PRE,
539540
String.format(
540541
"fixup to -> %08x",
541542
loaderOptions.getBaseAddress(f.objectNumber) + f.targetOffset
@@ -560,7 +561,7 @@ private void log(String format, Object... args) {
560561

561562
@Override
562563
public List<Option> getDefaultOptions(ByteProvider provider, LoadSpec loadSpec,
563-
DomainObject domainObject, boolean isLoadIntoProgram) {
564+
DomainObject domainObject, boolean isLoadIntoProgram, boolean mirrorFsLayout) {
564565
return loaderOptions.getDefaultOptions(provider, loadSpec, domainObject, isLoadIntoProgram);
565566
}
566567

0 commit comments

Comments
 (0)