Index: llvm/lib/Target/TargetMachine.cpp =================================================================== --- llvm/lib/Target/TargetMachine.cpp +++ llvm/lib/Target/TargetMachine.cpp @@ -141,9 +141,7 @@ // produce a 0 if it turns out the symbol is undefined. While this // is ABI and relocation depended, it seems worth it to handle it // here. - // FIXME: this is probably not ELF specific. - if (GV && isPositionIndependent() && TT.isOSBinFormatELF() && - GV->hasExternalWeakLinkage()) + if (GV && isPositionIndependent() && GV->hasExternalWeakLinkage()) return false; if (GV && !GV->hasDefaultVisibility()) Index: llvm/test/CodeGen/X86/hidden-vis-3.ll =================================================================== --- llvm/test/CodeGen/X86/hidden-vis-3.ll +++ llvm/test/CodeGen/X86/hidden-vis-3.ll @@ -10,7 +10,7 @@ ; X32: movl _y, %eax ; X64: _t: -; X64: movl _y(%rip), %eax +; X64: movq _y@GOTPCREL(%rip), %rax %0 = load i32, i32* @x, align 4 ; [#uses=1] %1 = load i32, i32* @y, align 4 ; [#uses=1]