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 @@ -3699,13 +3699,15 @@ static llvm::GlobalVariable *createGOTEquivalent(IRGenModule &IGM,
3699
3699
llvm::GlobalValue::PrivateLinkage,
3700
3700
global,
3701
3701
llvm::Twine (" got." ) + globalName);
3702
-
3702
+
3703
3703
// rdar://problem/53836960: i386 ld64 also mis-links relative references
3704
3704
// to GOT entries.
3705
3705
// rdar://problem/59782487: issue with on-device JITd expressions.
3706
3706
// The JIT gets confused by private vars accessed across object files.
3707
+ // rdar://148168098: ELF x86 GOTPCREL relaxation can break metadata.
3707
3708
if (!IGM.getOptions ().UseJIT &&
3708
- (!IGM.Triple .isOSDarwin () || IGM.Triple .getArch () != llvm::Triple::x86)) {
3709
+ (!IGM.Triple .isOSDarwin () || IGM.Triple .getArch () != llvm::Triple::x86) &&
3710
+ (!IGM.Triple .isOSBinFormatELF () || !IGM.Triple .isX86 ())) {
3709
3711
gotEquivalent->setUnnamedAddr (llvm::GlobalValue::UnnamedAddr::Global);
3710
3712
} else {
3711
3713
ApplyIRLinkage (IRLinkage::InternalLinkOnceODR)
You can’t perform that action at this time.
0 commit comments