In my work applying -flto to Chrome, I need to set some names to be skipped by the InternalizePass; otherwise, the linking stage fails (i.e., when building the chrome binary). In the past, I had a tiny patch that I hadn’t submitted to LLVM: it was something like:
The current plugin doesn't even use internalize. It depends on the
linker's decision of what should be kept. Given that, your best option
is convincing the linker that the symbol is needed. One way to do it
is with the -u option:
If you're able to modify IR, you should also be able to keep `@f` around
by adding it to `@llvm.used`.
so I didn't need to try modifying the IR in this case. Thanks!