mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Revert "GP-710 Added register symbol processing to ELF PIC30 import processing. Improved code unit operand format to render memory register name when no reference is present."
This reverts commit c545a6fb5a.
This commit is contained in:
@@ -22,9 +22,7 @@ import ghidra.app.util.bin.format.elf.*;
|
||||
import ghidra.program.model.address.Address;
|
||||
import ghidra.program.model.address.AddressSpace;
|
||||
import ghidra.program.model.lang.Language;
|
||||
import ghidra.program.model.lang.Register;
|
||||
import ghidra.util.exception.CancelledException;
|
||||
import ghidra.util.exception.NoValueException;
|
||||
import ghidra.util.task.TaskMonitor;
|
||||
|
||||
public class PIC30_ElfExtension extends ElfExtension {
|
||||
@@ -221,32 +219,6 @@ public class PIC30_ElfExtension extends ElfExtension {
|
||||
return language.getDefaultDataSpace().equals(start.getAddressSpace().getPhysicalSpace());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Address calculateSymbolAddress(ElfLoadHelper elfLoadHelper, ElfSymbol elfSymbol)
|
||||
throws NoValueException {
|
||||
|
||||
if (elfSymbol.getValue() != 0 || !elfSymbol.isGlobal() ||
|
||||
elfSymbol.getSectionHeaderIndex() != 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
String name = elfSymbol.getNameAsString();
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (name.startsWith("_")) {
|
||||
name = name.substring(1);
|
||||
}
|
||||
|
||||
Register reg = elfLoadHelper.getProgram().getRegister(name);
|
||||
if (reg != null && !reg.getAddress().isRegisterAddress()) {
|
||||
return reg.getAddress(); // only consider memory-based registers
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static class PIC30FilteredDataInputStream extends FilterInputStream {
|
||||
|
||||
// BYTES: <byte> <pad>
|
||||
|
||||
Reference in New Issue
Block a user