|
@@ -763,6 +763,13 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM,
|
|
!GV->isThreadLocal())
|
|
!GV->isThreadLocal())
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ // On COFF, don't mark 'extern_weak' symbols as DSO local. If these symbols
|
|
|
|
+ // remain unresolved in the link, they can be resolved to zero, which is
|
|
|
|
+ // outside the current DSO.
|
|
|
|
+ if (TT.isOSBinFormatCOFF() && GV->hasExternalWeakLinkage())
|
|
|
|
+ return false;
|
|
|
|
+
|
|
// Every other GV is local on COFF.
|
|
// Every other GV is local on COFF.
|
|
// Make an exception for windows OS in the triple: Some firmware builds use
|
|
// Make an exception for windows OS in the triple: Some firmware builds use
|
|
// *-win32-macho triples. This (accidentally?) produced windows relocations
|
|
// *-win32-macho triples. This (accidentally?) produced windows relocations
|