GP-2703 revised ELF relocation processing to handle statically linked

binaries and adjusted post-relocation read-only memory fixup.
This commit is contained in:
ghidra1 2022-10-14 17:15:47 -04:00
parent 0b17f7d095
commit 6b9bd6c220
19 changed files with 210 additions and 213 deletions

View file

@ -68,8 +68,8 @@ public class ARM_ElfRelocationHandler extends ElfRelocationHandler {
long addend = relocation.getAddend(); // will be 0 for REL case
ElfSymbol sym = elfRelocationContext.getSymbol(symbolIndex);
String symbolName = sym.getNameAsString();
ElfSymbol sym = elfRelocationContext.getSymbol(symbolIndex); // may be null
String symbolName = elfRelocationContext.getSymbolName(symbolIndex);
boolean isThumb = isThumb(sym);
@ -701,7 +701,7 @@ public class ARM_ElfRelocationHandler extends ElfRelocationHandler {
}
private boolean isThumb(ElfSymbol symbol) {
if (symbol.isFunction() && (symbol.getValue() % 1) == 1) {
if (symbol != null && symbol.isFunction() && (symbol.getValue() % 1) == 1) {
return true;
}
return false;