If %t1.o has a weak reference, %t2.so has a non-weak reference.
ld.lld %t1.o %t2.so -o %t
The reference in %t should be weak, but it is non-weak (and thus causes an "undefined symbol" error) because currently we don't ignore Undefined in a SharedFile.
This fixes an (-z defs) error when linking libLLVMCore.so with lld after D63974.
ld.lld: error: undefined symbol: pthread_once
libstdc++ std::call_once creates a weak reference of pthread_once.
This is its hack to avoid a dependency on libpthread.so
* Object files with std::call_once calls have such weak references.
* libLLVMSupport.so.9svn has a non-weak reference that changes the
binding. It should be ignored instead.
When these objects and libLLVMSupport.so.9svn are linked together to
create a shared object (note there is no -lpthread), the final binding
will be non-weak and an "undefined symbol" error will be issued.
We happened to work before D63974 because libgcc_s.so.1 was linked the
last and it changed the binding again to weak.