summaryrefslogtreecommitdiffstats
path: root/lld/ELF/Target.h
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2015-10-16 21:55:40 +0000
committerHal Finkel <hfinkel@anl.gov>2015-10-16 21:55:40 +0000
commit6f97c2bc00208fbde954146104a8a8c7842e9b32 (patch)
tree62b67d1525473096acbbbb8e061d27a991d2a7df /lld/ELF/Target.h
parent3d5b48c4804f2442ed42e1e93f226f08abd7b14e (diff)
downloadbcm5719-llvm-6f97c2bc00208fbde954146104a8a8c7842e9b32.tar.gz
bcm5719-llvm-6f97c2bc00208fbde954146104a8a8c7842e9b32.zip
[ELF2] getLocalRelTarget should handle R_PPC64_TOC directly
R_PPC64_TOC does not have an associated symbol, but does have a non-zero VA that target-specific code must compute using some non-trivial rule. We handled this as a special case in PPC64TargetInfo::relocateOne, where we knew to write this special address, but that did not work when creating shared libraries. The special TOC address needs to be the subject of a R_PPC64_RELATIVE relocation, and so we also need to know how to encode this special address in the addend of that relocation. Thus, some target-specific logic is necessary when creating R_PPC64_RELATIVE as well. To solve this problem, we teach getLocalRelTarget to handle R_PPC64_TOC as a special case. This allows us to remove the special case in PPC64TargetInfo::relocateOne (simplifying code there), and naturally allows the existing logic to do the right thing when creating associated R_PPC64_RELATIVE relocations for shared libraries. llvm-svn: 250555
Diffstat (limited to 'lld/ELF/Target.h')
-rw-r--r--lld/ELF/Target.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lld/ELF/Target.h b/lld/ELF/Target.h
index ff770e1a477..1faaf02931d 100644
--- a/lld/ELF/Target.h
+++ b/lld/ELF/Target.h
@@ -58,6 +58,8 @@ protected:
unsigned PltEntrySize = 8;
};
+uint64_t getPPC64TocBase();
+
extern std::unique_ptr<TargetInfo> Target;
TargetInfo *createTarget();
}
OpenPOWER on IntegriCloud