[mips][ias] Expand on r238751 to cover as many relocs as possible.
authorDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 16 Jun 2015 13:46:26 +0000 (13:46 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 16 Jun 2015 13:46:26 +0000 (13:46 +0000)
commitb17a563e9a99e5645e7b618958917e4be0034715
tree2a0cf248ca527c3bbc26cd667f293dbfe7da3d41
parent7f5b833aa301e25b9d8d5eb101f4bfad12d42a65
[mips][ias] Expand on r238751 to cover as many relocs as possible.

Summary:
Relocs that can be converted from absolute to PC-relative now do so if IsPCRel
is true. Relocs that require PC-relative now call llvm_unreachable() if IsPCRel
is false and similarly those that require absolute assert that IsPCRel is false.

Note that while it looks like some relocs (e.g. R_MIPS_26) can be converted into
the MIPS32r6/MIPS64r6 relocs (R_MIPS_PC*_S2), it isn't actually valid to do so.

Placeholders have been left in the testcase for unsupported relocs and relocs
that cannot be generated at the moment.

Reviewers: vkalintiris

Reviewed By: vkalintiris

Subscribers: llvm-commits, rafael

Differential Revision: http://reviews.llvm.org/D10184

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239817 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
test/MC/Mips/mips-relocations.s [deleted file]
test/MC/Mips/relocation.s