GP-5918 Corrected ELF Relocation regression for MIPS 64-bit introduced

with GP-5826 in Ghidra 11.4.1
This commit is contained in:
ghidra1
2025-08-11 12:45:37 -04:00
parent 8055da80b8
commit f7138da6f7

View File

@@ -357,8 +357,14 @@ public class MIPS_ElfRelocationHandler
}
value = symbolValue;
if (elfRelocationContext.extractAddend()) {
// extract addend based upon pointer size
addend = memory.getInt(relocationAddress);
// Extract addend based upon pointer size when saving 64-bit addend
// for packed relocation type
if (saveValue && program.getDefaultPointerSize() == 8) {
addend = memory.getLong(relocationAddress);
}
else {
addend = memory.getInt(relocationAddress);
}
}
newValue = value + addend;