forked from OSchip/llvm-project
[PowerPC] Fix regression in generating @ha/@l relocs
The patch I committed as revision 167864 introduced a regression that causes LLVM to no longer generate appropriate relocs for @ha/@l symbol references (but fail an assertion instead). This is fixed here by re-enabling support for the VK_PPC_GAS_HA16/ VK_PPC_GAS_LO16 variant kinds (and their Darwin variants) in PPCELFObjectWriter.cpp. Tested by running projects/test-suite in -m32 mode with the integrated assembler forced on. A standalone test case will be committed shortly as well. llvm-svn: 181450
This commit is contained in:
parent
38b6cb51bc
commit
e462053f64
|
@ -107,7 +107,8 @@ unsigned PPCELFObjectWriter::getRelocTypeInner(const MCValue &Target,
|
|||
case MCSymbolRefExpr::VK_PPC_DTPREL16_HA:
|
||||
Type = ELF::R_PPC64_DTPREL16_HA;
|
||||
break;
|
||||
case MCSymbolRefExpr::VK_None:
|
||||
case MCSymbolRefExpr::VK_PPC_GAS_HA16:
|
||||
case MCSymbolRefExpr::VK_PPC_DARWIN_HA16:
|
||||
Type = ELF::R_PPC_ADDR16_HA;
|
||||
break;
|
||||
case MCSymbolRefExpr::VK_PPC_TOC16_HA:
|
||||
|
@ -134,6 +135,10 @@ unsigned PPCELFObjectWriter::getRelocTypeInner(const MCValue &Target,
|
|||
Type = ELF::R_PPC64_DTPREL16_LO;
|
||||
break;
|
||||
case MCSymbolRefExpr::VK_None:
|
||||
Type = ELF::R_PPC_ADDR16;
|
||||
break;
|
||||
case MCSymbolRefExpr::VK_PPC_GAS_LO16:
|
||||
case MCSymbolRefExpr::VK_PPC_DARWIN_LO16:
|
||||
Type = ELF::R_PPC_ADDR16_LO;
|
||||
break;
|
||||
case MCSymbolRefExpr::VK_PPC_TOC_ENTRY:
|
||||
|
@ -156,6 +161,10 @@ unsigned PPCELFObjectWriter::getRelocTypeInner(const MCValue &Target,
|
|||
case MCSymbolRefExpr::VK_None:
|
||||
Type = ELF::R_PPC64_ADDR16_DS;
|
||||
break;
|
||||
case MCSymbolRefExpr::VK_PPC_GAS_LO16:
|
||||
case MCSymbolRefExpr::VK_PPC_DARWIN_LO16:
|
||||
Type = ELF::R_PPC64_ADDR16_LO_DS;
|
||||
break;
|
||||
case MCSymbolRefExpr::VK_PPC_TOC_ENTRY:
|
||||
Type = ELF::R_PPC64_TOC16_DS;
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue