On Thu, 14 Jun 2018, Alexander Monakov wrote: > However, it is not added to LTO streamed-out symtab, so WPA does not see it. > > If the direction looks fine overall, I'll look into getting over this > streaming hurdle (hints much appreciated).
Well, going down this rabbit hole is a fine exercise, but the idea seems to require changes in too many places. There's also the problems that it can solve only a subset of toplevel-asm-related issues, and won't gracefully work for variables (we'd warn about ignoring the attribute on an extern decl). So, let me withdraw this - sorry for the noise. Alexander