https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66523
Iain Sandoe <iains at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-07-07 Ever confirmed|0 |1 --- Comment #8 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Iain Sandoe from comment #7) > (In reply to m...@gcc.gnu.org from comment #6) > > Another proposal, any symbol with an 'L.*' spelling should be not so marked, > > as these can never be used this way. Seems like we should have a predicate > > to call before marking something as no dead strip and it should get rid of > > all of them, including L.* symbols. > > that's pretty much what my comment says - however, what I want to check > (when I get a spare ns) is whether ObjC should be emitting "l_xxx" symbols > for these (i.e. linker-only-visible, but not preserved). If someone else > has time to look before me, then fine :) So, I had a look at what Apple gcc-4.2.1 and current TOT clang produce. gcc-4.2.1 is silent about preservation. clang puts the relevant stuff into sections marked as "no_dead_strip" (but doesn't mark the individual symbols). For LTO to work we need to mark these items as non-strippable, because that happens in a way that won't see that the containing section is "no_dead_strip". Thus, for now, I think that the patch I have in my Q is OK. (as a follow-on, I think to revise the section headers to ensure that they contain "no_dead_strip", but that needs to be checked to be compatible with the range of ld64 variants we use). The current patch does what Mike has suggested above - rejects symbols starting with L* as no_dead_strip. Any other opinions (or shall I post/apply the patch)?