summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2016-10-03 20:11:24 +0000
committerMatthias Braun <matze@braunis.de>2016-10-03 20:11:24 +0000
commiteccdee91960e28dd305d8daa5fc874a57ded65e9 (patch)
treeebf0b97f756d41003123b983b02790a76aea27da /llvm/lib/Target/TargetMachine.cpp
parentab5478a9c669e3e947140eaef22b68220834e73c (diff)
downloadbcm5719-llvm-eccdee91960e28dd305d8daa5fc874a57ded65e9.tar.gz
bcm5719-llvm-eccdee91960e28dd305d8daa5fc874a57ded65e9.zip
X86: Do not produce GOT relocations on windows
Windows has no GOT relocations the way elf/darwin has. Some people use x86_64-pc-win32-macho to build EFI firmware; Do not produce GOT relocations for this target. Differential Revision: https://reviews.llvm.org/D24627 llvm-svn: 283140
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 17caed97391..d7b34f84afc 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -127,8 +127,11 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M,
if (GV && GV->hasDLLImportStorageClass())
return false;
- // Every other GV is local on COFF
- if (TT.isOSBinFormatCOFF())
+ // Every other GV is local on COFF.
+ // Make an exception for windows OS in the triple: Some firmwares builds use
+ // *-win32-macho triples. This (accidentally?) produced windows relocations
+ // without GOT tables in older clang versions; Keep this behaviour.
+ if (TT.isOSBinFormatCOFF() || TT.isOSWindows())
return true;
if (GV && (GV->hasLocalLinkage() || !GV->hasDefaultVisibility()))
OpenPOWER on IntegriCloud