File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -3736,13 +3736,15 @@ static llvm::GlobalVariable *createGOTEquivalent(IRGenModule &IGM,
3736
3736
llvm::GlobalValue::PrivateLinkage,
3737
3737
global,
3738
3738
llvm::Twine (" got." ) + globalName);
3739
-
3739
+
3740
3740
// rdar://problem/53836960: i386 ld64 also mis-links relative references
3741
3741
// to GOT entries.
3742
3742
// rdar://problem/59782487: issue with on-device JITd expressions.
3743
3743
// The JIT gets confused by private vars accessed across object files.
3744
+ // rdar://148168098: ELF x86 GOTPCREL relaxation can break metadata.
3744
3745
if (!IGM.getOptions ().UseJIT &&
3745
- (!IGM.Triple .isOSDarwin () || IGM.Triple .getArch () != llvm::Triple::x86)) {
3746
+ (!IGM.Triple .isOSDarwin () || IGM.Triple .getArch () != llvm::Triple::x86) &&
3747
+ (!IGM.Triple .isOSBinFormatELF () || !IGM.Triple .isX86 ())) {
3746
3748
gotEquivalent->setUnnamedAddr (llvm::GlobalValue::UnnamedAddr::Global);
3747
3749
} else {
3748
3750
ApplyIRLinkage (IRLinkage::InternalLinkOnceODR)
You can’t perform that action at this time.
0 commit comments