[Mips] Reduce code duplication. Join relocation handling functions which
perform similar calculations.