summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2017-01-26 15:02:31 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2017-01-26 15:02:31 +0000
commit82149a1aa961a7870c2cb8f6bad6fb4f1dc9a29a (patch)
tree23bdf08183d90600f7d6d8547b50c1fa6992cd92 /llvm/lib/Target/TargetMachine.cpp
parenta98b5fd999bda84b6585875a92d5f31da2b371af (diff)
downloadbcm5719-llvm-82149a1aa961a7870c2cb8f6bad6fb4f1dc9a29a.tar.gz
bcm5719-llvm-82149a1aa961a7870c2cb8f6bad6fb4f1dc9a29a.zip
Use shouldAssumeDSOLocal in classifyGlobalReference.
And teach shouldAssumeDSOLocal that ppc has no copy relocations. The resulting code handle a few more case than before. For example, it knows that a weak symbol can be resolved to another .o file, but it will still be in the main executable. llvm-svn: 293180
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index 438c62dd5ae..4beecb4dbb6 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -163,8 +163,11 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M,
bool IsTLS = GV && GV->isThreadLocal();
bool IsAccessViaCopyRelocs =
Options.MCOptions.MCPIECopyRelocations && GV && isa<GlobalVariable>(GV);
- // Check if we can use copy relocations.
- if (!IsTLS && (RM == Reloc::Static || IsAccessViaCopyRelocs))
+ Triple::ArchType Arch = TT.getArch();
+ bool IsPPC =
+ Arch == Triple::ppc || Arch == Triple::ppc64 || Arch == Triple::ppc64le;
+ // Check if we can use copy relocations. PowerPC has no copy relocations.
+ if (!IsTLS && !IsPPC && (RM == Reloc::Static || IsAccessViaCopyRelocs))
return true;
}
OpenPOWER on IntegriCloud