Index: ELF/Target.h =================================================================== --- ELF/Target.h +++ ELF/Target.h @@ -87,6 +87,7 @@ void relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type, uint64_t BaseAddr, uint64_t SymVA, uint64_t GotVA) const override; + bool isRelRelative(uint32_t Type) const override; }; class PPCTargetInfo final : public TargetInfo { Index: ELF/Target.cpp =================================================================== --- ELF/Target.cpp +++ ELF/Target.cpp @@ -240,6 +240,7 @@ PCRelReloc = R_PPC64_REL24; GotReloc = R_PPC64_GLOB_DAT; GotRefReloc = R_PPC64_REL64; + RelativeReloc = R_PPC64_RELATIVE; PltEntrySize = 32; PageSize = 0x10000; VAStart = 0x10000000; @@ -300,6 +301,18 @@ return S.isShared() || (S.isUndefined() && S.isWeak()); } } +bool PPC64TargetInfo::isRelRelative(uint32_t Type) const { + switch (Type) { + default: + return false; + case R_PPC64_REL24: + case R_PPC64_REL14: + case R_PPC64_REL14_BRTAKEN: + case R_PPC64_REL14_BRNTAKEN: + case R_PPC64_REL32: + return true; + } +} void PPC64TargetInfo::relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type, uint64_t BaseAddr, uint64_t SymVA, uint64_t GotVA) const {