Skip to content

Commit 8f8386b

Browse files
authored
Merge pull request #814 from fjtrujy/srxfixup_relative-branch
[iop]: run `srxfixup` with `--rb` during link to convert relative branches (fixes `J/JAL` reloc incompatibilities)
2 parents 2bac3a6 + 3fa3704 commit 8f8386b

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

iop/Rules.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ $(IOP_BIN_STRIPPED_ELF): $(IOP_BIN_ELF)
146146
$(IOP_STRIP) --strip-unneeded --remove-section=.pdr --remove-section=.comment --remove-section=.mdebug.abi32 --remove-section=.gnu.attributes -o $@ $<
147147

148148
$(IOP_BIN): $(IOP_BIN_STRIPPED_ELF) $(PS2SDKSRC)/tools/srxfixup/bin/srxfixup
149-
$(PS2SDKSRC)/tools/srxfixup/bin/srxfixup --irx1 -o $@ $<
149+
$(PS2SDKSRC)/tools/srxfixup/bin/srxfixup --rb --irx1 -o $@ $<
150150

151151
$(IOP_LIB)_tmp$(MAKE_CURPID): $(IOP_OBJS)
152152
$(DIR_GUARD)

tools/srxfixup/src/srxgen.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ static void fixlocation_an_rel(elf_section *relsect, unsigned int startaddr)
412412
datal = &relsect->info->data[rp->rel.r_offset - relsect->info->shr.sh_addr];
413413
switch ( rp->type )
414414
{
415+
case R_MIPS_NONE:
416+
break;
415417
case R_MIPS_16:
416418
data_1 = startaddr + (int16_t)*(uint32_t *)datal;
417419
if ( (uint16_t)(data_1 >> 16) )

0 commit comments

Comments
 (0)