Handle undefined weak hidden symbols on all architectures.
authorRafael Espindola <rafael.espindola@gmail.com>
Fri, 27 Oct 2017 21:18:48 +0000 (21:18 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Fri, 27 Oct 2017 21:18:48 +0000 (21:18 +0000)
commit2393c3b4e12460cd9c430840e21d333ad6294b5a
treefc638ebba802bbde25b96b36455c3443693b84d4
parent94f5032aedbd49e2f828e2bb31c006332c2bcaa7
Handle undefined weak hidden symbols on all architectures.

We were handling the non-hidden case in lib/Target/TargetMachine.cpp,
but the hidden case was handled in architecture dependent code and
only X86_64 and AArch64 were covered.

While it is true that some code sequences in some ABIs might be able
to produce the correct value at runtime, that doesn't seem to be the
common case.

I left the AArch64 code in place since it also forces a got access for
non-pic code. It is not clear if that is needed, but it is probably
better to change that in another commit.

llvm-svn: 316799
llvm/lib/Target/TargetMachine.cpp
llvm/lib/Target/X86/X86Subtarget.cpp
llvm/test/CodeGen/X86/global-access-pie-copyrelocs.ll
llvm/test/CodeGen/X86/weak-undef.ll