diff options
author | Martell Malone <martellmalone@gmail.com> | 2018-12-04 12:26:21 +0000 |
---|---|---|
committer | Martell Malone <martellmalone@gmail.com> | 2018-12-04 12:26:21 +0000 |
commit | aa6086a64c8c5bfaf67891c1a974532a206ac304 (patch) | |
tree | b214949bd1b73cfd5c126eacd0597de7349f6a27 /lld/ELF/Arch/PPC.cpp | |
parent | 58d44235e5026a9ee3275b6db12a2115caf7b90f (diff) | |
download | bcm5719-llvm-aa6086a64c8c5bfaf67891c1a974532a206ac304.tar.gz bcm5719-llvm-aa6086a64c8c5bfaf67891c1a974532a206ac304.zip |
[PPC][PPC64] PPC_REL14 and PPC64_REL14 relocations
When linking the linux kernel on ppc64 and ppc
ld.lld: error: unrecognized reloc 11
11 is PPC_REL14 and PPC64_REL14
Differential revision: https://reviews.llvm.org/D54868
llvm-svn: 348255
Diffstat (limited to 'lld/ELF/Arch/PPC.cpp')
-rw-r--r-- | lld/ELF/Arch/PPC.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lld/ELF/Arch/PPC.cpp b/lld/ELF/Arch/PPC.cpp index a01068ccd36..76737806734 100644 --- a/lld/ELF/Arch/PPC.cpp +++ b/lld/ELF/Arch/PPC.cpp @@ -37,6 +37,7 @@ PPC::PPC() { RelExpr PPC::getRelExpr(RelType Type, const Symbol &S, const uint8_t *Loc) const { switch (Type) { + case R_PPC_REL14: case R_PPC_REL24: case R_PPC_REL32: return R_PC; @@ -62,6 +63,9 @@ void PPC::relocateOne(uint8_t *Loc, RelType Type, uint64_t Val) const { case R_PPC_REL32: write32be(Loc, Val); break; + case R_PPC_REL14: + write32be(Loc, read32be(Loc) | (Val & 0xFFFC)); + break; case R_PPC_PLTREL24: case R_PPC_REL24: write32be(Loc, read32be(Loc) | (Val & 0x3FFFFFC)); |