diff options
Diffstat (limited to 'lld/ELF/Target.cpp')
| -rw-r--r-- | lld/ELF/Target.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp index 4ecc80b592c..f45b6c54c2c 100644 --- a/lld/ELF/Target.cpp +++ b/lld/ELF/Target.cpp @@ -345,7 +345,7 @@ PPC64TargetInfo::PPC64TargetInfo() { VAStart = 0x10000000; } -static uint64_t getPPC64TocBase() { +uint64_t getPPC64TocBase() { // The TOC consists of sections .got, .toc, .tocbss, .plt in that // order. The TOC starts where the first of these sections starts. @@ -426,11 +426,6 @@ void PPC64TargetInfo::relocateOne(uint8_t *Buf, uint8_t *BufEnd, uint64_t P = BaseAddr + Rel.r_offset; uint64_t TB = getPPC64TocBase(); - if (Type == R_PPC64_TOC) { - write64be(L, TB); - return; - } - // For a TOC-relative relocation, adjust the addend and proceed in terms of // the corresponding ADDR16 relocation type. switch (Type) { @@ -536,6 +531,7 @@ void PPC64TargetInfo::relocateOne(uint8_t *Buf, uint8_t *BufEnd, write64be(L, SA - P); break; case R_PPC64_ADDR64: + case R_PPC64_TOC: write64be(L, SA); break; default: |

