mirror of
https://github.com/grumpycoders/pcsx-redux.git
synced 2026-10-12 02:15:13 +00:00
tools/psyq-obj-parser: Fix GPREL16 behavior
`GPREL16` should behave identically to `GPREL16_LE`; it was previously blanking the relocation out entirely. This likely wasn't caught because according to testing, most versions of `aspsx` (2.67 and earlier) produce `GPREL16_LE` rather than `GPREL16`. It was only in 2.77 that `aspsx` switched to `GPREL16` for some reloc exprs.
This commit is contained in:
@@ -1295,11 +1295,7 @@ bool PsyqLnkFile::Relocation::generateElf(ElfRelocationPass pass, const std::str
|
||||
sectionData[offset + 1] = (uint8_t)(lo >> 8);
|
||||
break;
|
||||
}
|
||||
case PsyqRelocType::GPREL16: {
|
||||
sectionData[offset + 0] = 0;
|
||||
sectionData[offset + 1] = 0;
|
||||
break;
|
||||
}
|
||||
case PsyqRelocType::GPREL16:
|
||||
case PsyqRelocType::GPREL16_LE: {
|
||||
uint16_t lo = symbolOffset & 0xFFFF;
|
||||
sectionData[offset + 0] = (uint8_t)(lo >> 0);
|
||||
|
||||
Reference in New Issue
Block a user