mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 03:50:02 +02:00
GP-645 changed assembler to ignore external symbol names
This commit is contained in:
parent
f3889762e0
commit
f41eb4ab4d
1 changed files with 8 additions and 2 deletions
|
@ -29,8 +29,7 @@ import ghidra.program.model.lang.*;
|
||||||
import ghidra.program.model.listing.*;
|
import ghidra.program.model.listing.*;
|
||||||
import ghidra.program.model.mem.Memory;
|
import ghidra.program.model.mem.Memory;
|
||||||
import ghidra.program.model.mem.MemoryAccessException;
|
import ghidra.program.model.mem.MemoryAccessException;
|
||||||
import ghidra.program.model.symbol.Symbol;
|
import ghidra.program.model.symbol.*;
|
||||||
import ghidra.program.model.symbol.SymbolIterator;
|
|
||||||
import ghidra.util.task.TaskMonitor;
|
import ghidra.util.task.TaskMonitor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -240,6 +239,13 @@ public class SleighAssembler implements Assembler {
|
||||||
final SymbolIterator it = program.getSymbolTable().getAllSymbols(false);
|
final SymbolIterator it = program.getSymbolTable().getAllSymbols(false);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
Symbol sym = it.next();
|
Symbol sym = it.next();
|
||||||
|
if (sym.isExternal()) {
|
||||||
|
continue; // skip externals - will generally be referenced indirectly not directly
|
||||||
|
}
|
||||||
|
SymbolType symbolType = sym.getSymbolType();
|
||||||
|
if (symbolType != SymbolType.LABEL && symbolType != SymbolType.FUNCTION) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
labels.put(sym.getName(), sym.getAddress().getOffset());
|
labels.put(sym.getName(), sym.getAddress().getOffset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue