+2016-06-21 Maciej W. Rozycki <macro@imgtec.com>
+
+ * config/tc-mips.c (md_pcrel_from) <BFD_RELOC_MIPS_18_PCREL_S3>:
+ Calculate relocation from the containing aligned doubleword.
+ (tc_gen_reloc) <BFD_RELOC_MIPS_18_PCREL_S3>: Calculate the
+ addend from the containing aligned doubleword.
+
2016-06-21 Maciej W. Rozycki <macro@imgtec.com>
* config/tc-mips.c (mips_force_relocation): Use `file_mips_opts'
/* Return the address of the delay slot. */
return addr + 4;
+ case BFD_RELOC_MIPS_18_PCREL_S3:
+ /* Return the aligned address of the doubleword containing
+ the instruction. */
+ return addr & ~7;
+
default:
return addr;
}
/* At this point, fx_addnumber is "symbol offset - pcrel address".
Relocations want only the symbol offset. */
- reloc->addend = fixp->fx_addnumber + reloc->address;
+ switch (fixp->fx_r_type)
+ {
+ case BFD_RELOC_MIPS_18_PCREL_S3:
+ reloc->addend = fixp->fx_addnumber + (reloc->address & ~7);
+ break;
+ default:
+ reloc->addend = fixp->fx_addnumber + reloc->address;
+ break;
+ }
}
else if (HAVE_IN_PLACE_ADDENDS
&& fixp->fx_r_type == BFD_RELOC_MICROMIPS_JMP