If an extern_weak declaration is resolved as undefined, RAUW it with
a null pointer and remove it from the module before running LTO
optimizations.
Besides the obvious codegen improvement, it allows CFI to avoid
generating jump tables for such functions (which can not be done
correctly, as a jump table entry can not be weak).
Do we need to track this globally?