Skip to content

Commit

Permalink
Fixed relocations in rare cases (for sysmem.prx)
Browse files Browse the repository at this point in the history
  • Loading branch information
artart78 committed Feb 18, 2012
1 parent 05bd70e commit 647a957
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ProcessPrx.C
Original file line number Diff line number Diff line change
Expand Up @@ -1541,7 +1541,7 @@ void CProcessPrx::FixupRelocs(u32 dwBase, ImmMap &imms)
ImmEntry *imm;

loinst = LW(*pData);
addr = ((s16) (loinst & 0xFFFF)) + dwCurrBase;
addr = ((s16) (loinst & 0xFFFF) & 0xFFFF) + dwCurrBase;
COutput::Printf(LEVEL_DEBUG, "Low at (%08X)\n", dwRealOfs);

imm = new ImmEntry;
Expand All @@ -1551,7 +1551,7 @@ void CProcessPrx::FixupRelocs(u32 dwBase, ImmMap &imms)
imms[dwRealOfs + dwBase] = imm;

loinst &= ~0xFFFF;
loinst |= (addr & 0xFFFF);
loinst |= addr;
SW(*pData, loinst);
}
break;
Expand Down Expand Up @@ -1600,6 +1600,9 @@ void CProcessPrx::FixupRelocs(u32 dwBase, ImmMap &imms)
dwData = dwInst + (dwCurrBase >> 16);
SW(*pData, dwData);

if (off & 0x8000)
dwInst--;

if ((dwData >> 26) != 2) // not J instruction
{
imm = new ImmEntry;
Expand Down

0 comments on commit 647a957

Please sign in to comment.