summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Target.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2015-10-12 20:58:52 +0000
committerHal Finkel <hfinkel@anl.gov>2015-10-12 20:58:52 +0000
commitbe0823dcc4f91e735a381ba53bd977ad7c82d0f8 (patch)
tree0e4b8e9d04802e9dab5ee6769bd7deef1f84d3ac /lld/ELF/Target.cpp
parent3c8cc677e6dbf29e59343142a5f1627427f58844 (diff)
downloadbcm5719-llvm-be0823dcc4f91e735a381ba53bd977ad7c82d0f8.tar.gz
bcm5719-llvm-be0823dcc4f91e735a381ba53bd977ad7c82d0f8.zip
[ELF2] Implement PPC64TargetInfo::isRelRelative
This is essentially pattern-matching against the x86 target, and generates the analogous PPC64 relocation. llvm-svn: 250102
Diffstat (limited to 'lld/ELF/Target.cpp')
-rw-r--r--lld/ELF/Target.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lld/ELF/Target.cpp b/lld/ELF/Target.cpp
index df7b34cf849..8d3a3515d5a 100644
--- a/lld/ELF/Target.cpp
+++ b/lld/ELF/Target.cpp
@@ -221,6 +221,7 @@ PPC64TargetInfo::PPC64TargetInfo() {
PCRelReloc = R_PPC64_REL24;
GotReloc = R_PPC64_GLOB_DAT;
GotRefReloc = R_PPC64_REL64;
+ RelativeReloc = R_PPC64_RELATIVE;
PltEntrySize = 32;
// We need 64K pages (at least under glibc/Linux, the loader won't
@@ -291,6 +292,20 @@ bool PPC64TargetInfo::relocNeedsPlt(uint32_t Type, const SymbolBody &S) const {
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:
+ case R_PPC64_REL64:
+ return true;
+ }
+}
+
void PPC64TargetInfo::relocateOne(uint8_t *Buf, const void *RelP, uint32_t Type,
uint64_t BaseAddr, uint64_t SymVA) const {
typedef ELFFile<ELF64BE>::Elf_Rela Elf_Rela;
OpenPOWER on IntegriCloud