The attached patch adds support for .reloc directives, which I believe hasn't been implemented yet.
https://sourceware.org/binutils/docs/as/Reloc.html#Reloc
The initial motivation for adding this support was to enable linker optimization for mips. .reloc serves as a hint to the linker to turn a function call using jalr (jump and link register) into a pc-relative bal (branch and link), if the callee is close enough to the jalr.
(before optimization)
lw $25,%call16(foo2)($28)
.reloc $L1,R_MIPS_JALR,foo2
$L1: jalr $25
(after optimization)
lw $25,%call16(foo2)($28)
bal foo2
I also made a change in ELFObjectFile.h that was necessary for mips to print the symbol against which a relocation is applied (needed this for the test case).