summaryrefslogtreecommitdiff
path: root/gas/config/tc-mips.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas/config/tc-mips.c')
-rw-r--r--gas/config/tc-mips.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index ed64b689364..74f7e005607 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -14606,6 +14606,11 @@ md_pcrel_from (fixS *fixP)
/* 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;
}
@@ -17224,7 +17229,15 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp)
/* 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