Merge remote-tracking branch 'origin/patch'

This commit is contained in:
ghidra1 2022-02-11 18:27:46 -05:00
commit 1a1d06b749

View file

@ -573,9 +573,7 @@ public class ARM_ElfRelocationHandler extends ElfRelocationHandler {
addend = (oldValue << 21 >> 20); // extract addend and sign-extend with *2 factor addend = (oldValue << 21 >> 20); // extract addend and sign-extend with *2 factor
} }
newValue = (int) (symbolValue + addend); newValue = (int) (symbolValue + addend);
newValue -= offset; // PC relative
newValue -= (offset + 4); // PC relative, PC will be 4 bytes past inst start
newValue = (oldValue & 0x0000f800) | ((newValue >> 1) & 0x000007ff); newValue = (oldValue & 0x0000f800) | ((newValue >> 1) & 0x000007ff);
memory.setShort(relocationAddress, (short) newValue, instructionBigEndian); memory.setShort(relocationAddress, (short) newValue, instructionBigEndian);
break; break;
@ -586,9 +584,7 @@ public class ARM_ElfRelocationHandler extends ElfRelocationHandler {
addend = (oldValue << 24 >> 23); // extract addend and sign-extend with *2 factor addend = (oldValue << 24 >> 23); // extract addend and sign-extend with *2 factor
} }
newValue = (int) (symbolValue + addend); newValue = (int) (symbolValue + addend);
newValue -= offset; // PC relative
newValue -= (offset + 4); // PC relative, PC will be 4 bytes past inst start
newValue = (oldValue & 0x0000ff00) | ((newValue >> 1) & 0x000000ff); newValue = (oldValue & 0x0000ff00) | ((newValue >> 1) & 0x000000ff);
memory.setShort(relocationAddress, (short) newValue, instructionBigEndian); memory.setShort(relocationAddress, (short) newValue, instructionBigEndian);
break; break;