mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-164 Corrected ELF ARM R_ARM_REL32 (type 3) relocation processing
This commit is contained in:
@@ -91,9 +91,10 @@ public class ARM_ElfRelocationHandler extends ElfRelocationHandler {
|
|||||||
memory.setInt(relocationAddress, newValue);
|
memory.setInt(relocationAddress, newValue);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ARM_ElfRelocationConstants.R_ARM_REL32: { // // Target class: Data
|
case ARM_ElfRelocationConstants.R_ARM_REL32: { // Target class: Data
|
||||||
newValue = (int) (symbolValue + addend);
|
int oldValue = memory.getInt(relocationAddress);
|
||||||
newValue -= (offset + 8); // PC relative, PC will be 8 bytes after inst start
|
newValue = (int) (symbolValue + addend + oldValue);
|
||||||
|
newValue -= offset; // PC relative
|
||||||
if (isThumb) {
|
if (isThumb) {
|
||||||
newValue |= 1;
|
newValue |= 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user