A reference to __real_foo should trigger archive extraction of the input file that defines foo, otherwise a link using --wrap=foo might fail to link with an undefined reference to foo.
This matches bfd linker behaviour.
Replaces https://reviews.llvm.org/D135737.
If __real_ is referenced, pull in the symbol if it is lazy