Fix another relocation bug

This time I was swapping the meaning of the RelocBySectC/D opcodes. This wasn't terribly bad, because they were rarely used. I identified the bug while figuring out how to handle the rare fragment that uses XTOC glue to access its own guts in a patchable manner.
This commit is contained in:
Elliot Nunn 2019-10-18 13:21:28 +08:00
parent d70ad36327
commit cf5af0f5f1
1 changed files with 2 additions and 2 deletions

View File

@ -472,12 +472,12 @@ def dump_lowlevel(basepath):
if subopcode == 0b0000: # RelocBySectC
#print('RelocBySectC runLength=%d' % (runLength))
for i in range(runLength):
relocations.append(dict(section=sectionIndex, offset=relocAddress, to=('section', sectionD))); relocAddress += 4
relocations.append(dict(section=sectionIndex, offset=relocAddress, to=('section', sectionC))); relocAddress += 4
elif subopcode == 0b0001: # RelocBySectD
#print('RelocBySectD runLength=%d' % (runLength))
for i in range(runLength):
relocations.append(dict(section=sectionIndex, offset=relocAddress, to=('section', sectionC))); relocAddress += 4
relocations.append(dict(section=sectionIndex, offset=relocAddress, to=('section', sectionD))); relocAddress += 4
elif subopcode == 0b0010: # RelocTVector12
#print('RelocTVector12 runLength=%d' % (runLength))