[PPC] Fix PR24686 by failing assembly for an invalid relocation
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Thu, 22 Oct 2015 15:53:44 +0000 (15:53 +0000)
committerBill Schmidt <wschmidt@linux.vnet.ibm.com>
Thu, 22 Oct 2015 15:53:44 +0000 (15:53 +0000)
commite2e776f769c27150b229c465b0730b140393e580
tree063af0c762d8cdc87b18a12ad2f98aa729efffa9
parent1183c6f920bc348a614ac486f7bea660aeedc114
[PPC] Fix PR24686 by failing assembly for an invalid relocation

PR24686 identifies a problem where a relocation expression is invalid
when not all of the symbols in the expression can be locally
resolved.  This causes the compiler to request a PC-relative half16ds
relocation, which is nonsensical for PowerPC.  This patch recognizes
this situation and ensures we fail the assembly cleanly.

Test case provided by Anton Blanchard.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251027 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp
test/MC/PowerPC/pr24686.s [new file with mode: 0644]