mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-24 21:21:56 +00:00
GP-710 Added support for additional PIC30 ELF relocations (closes #2792)
This commit is contained in:
parent
d12d1ec739
commit
9c1fed6a13
@ -155,15 +155,25 @@ public class PIC30_ElfRelocationHandler extends ElfRelocationHandler {
|
||||
if (elf.e_machine() == ElfConstants.EM_DSPIC30F) {
|
||||
switch (type) {
|
||||
case R_PIC30_16: // 2
|
||||
newValue = (symbolValue + addend + oldShortValue) & 0xffff;
|
||||
case R_PIC30_FILE_REG_WORD: // 6
|
||||
newValue = (symbolValue + addend + oldShortValue);
|
||||
memory.setShort(relocationAddress, (short) newValue);
|
||||
break;
|
||||
case R_PIC30_32: // 3
|
||||
newValue = symbolValue + addend + oldValue;
|
||||
memory.setInt(relocationAddress, newValue);
|
||||
break;
|
||||
case R_PIC30_FILE_REG_BYTE: // 4 short
|
||||
case R_PIC30_FILE_REG: // 5 short
|
||||
int reloc = symbolValue;
|
||||
reloc += addend;
|
||||
reloc += oldShortValue;
|
||||
reloc &= 0x1fff;
|
||||
newValue = reloc | (oldShortValue & ~0x1fff);
|
||||
memory.setShort(relocationAddress, (short) newValue);
|
||||
break;
|
||||
case R_PIC30_FILE_REG_WORD_WITH_DST: // 7
|
||||
int reloc = symbolValue >> 1;
|
||||
reloc = symbolValue >> 1;
|
||||
reloc += addend;
|
||||
reloc += oldValue >> 4;
|
||||
reloc &= 0x7fff;
|
||||
|
Loading…
Reference in New Issue
Block a user