GP-1571 ELF: create fake relocation table entry for non-relocation memory modifications (needed for ELF export)

This commit is contained in:
ghidra1
2021-12-13 14:52:24 -05:00
parent b5927ce849
commit 9076b2429c
5 changed files with 66 additions and 17 deletions

View File

@@ -113,9 +113,10 @@ public class PowerPC_ElfExtension extends ElfExtension {
// Update first got entry normally updated by link editor to refer to dynamic table
int dynamicOffset =
memory.getInt(gotAddr) + (int) elfLoadHelper.getImageBaseWordAdjustmentOffset();
elfLoadHelper.addFakeRelocTableEntry(gotAddr, 4);
memory.setInt(gotAddr, dynamicOffset);
}
catch (MemoryAccessException e) {
catch (MemoryAccessException | AddressOverflowException e) {
elfLoadHelper.log(e);
}
}