If foo is referenced in any object file, bitcode file or shared object,
__wrap_foo should be retained as the redirection target of sym
(f96ff3c0f8ebd941b3f6b345164c3d858b781484).
If the object file defining foo has foo references, we cannot easily distinguish
the case from cases where foo is not referenced (we haven't scanned
relocations). Retain __wrap_foo because we choose to wrap sym references
regardless of whether sym is defined to keep non-LTO/LTO/relocatable links' behaviors similar
https://sourceware.org/bugzilla/show_bug.cgi?id=26358 .
If foo is defined in a shared object, __wrap_foo can still be omitted
(wrap-dynamic-undef.s).