summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-06-13 08:45:22 +0000
committerFangrui Song <maskray@google.com>2019-06-13 08:45:22 +0000
commita78e025558b5e0018019d99ced62ddec05f115e5 (patch)
tree5e51b0acaf991ec54d29aa9ed164f4554c65d283
parent179e0fa8815e86b169594e5cfb177b2270d5001f (diff)
downloadbcm5719-llvm-a78e025558b5e0018019d99ced62ddec05f115e5.tar.gz
bcm5719-llvm-a78e025558b5e0018019d99ced62ddec05f115e5.zip
[ELF] Loosen the condition that changes absolute relocation types to relative relocations for ARM and PPC64
Try fixing build bots after D63121 llvm-svn: 363236
-rw-r--r--lld/ELF/Relocations.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index 702cac3843a..1398d3335c0 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -930,7 +930,13 @@ static void processRelocAux(InputSectionBase &Sec, RelExpr Expr, RelType Type,
}
bool CanWrite = (Sec.Flags & SHF_WRITE) || !Config->ZText;
if (CanWrite) {
- if ((!Sym.IsPreemptible && Type == Target->SymbolicRel) || Expr == R_GOT) {
+ // FIXME Improve the way we handle absolute relocation types that will
+ // change to relative relocations. ARM has a relocation type R_ARM_TARGET1
+ // that is similar to SymbolicRel. PPC64 may have similar relocation types.
+ if ((!Sym.IsPreemptible &&
+ (Config->EMachine == EM_ARM || Config->EMachine == EM_PPC64 ||
+ Type == Target->SymbolicRel)) ||
+ Expr == R_GOT) {
// If this is a symbolic relocation to a non-preemptable symbol, or an
// R_GOT, its address is its link-time value plus load address. Represent
// it with a relative relocation.
OpenPOWER on IntegriCloud