gold --icf=safe is used in some Android and Chrome builds.
In C++, ctors and dtors are not allowed to be taken addresses. This
property is exploited by gold --icf=safe to fold only ctors and dtors,
and functions whose addresses are not taken (by checking target-specific relocations).
Checking relocation is too hacky and we should avoid that.
This revision implements a weak version of --icf=safe by checking only ctors and dtors. It might be less effective than gold --icf=safe, but would allow Android/Chrome/... builds to pass.