https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80407

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |lto
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-04-12
                 CC|                            |hubicka at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
> cat libx.res
1
m.o 3
165 e2668d19ae58a8ab PREVAILING_DEF_IRONLY x
180 e2668d19ae58a8ab PREVAILING_DEF main
185 e2668d19ae58a8ab UNDEF y

which is the issue - 'x' is viewed as only used from m.o but without
--as-needed it would be used by libx.so as well.

This looks like a linker bug to me.  It works fine when using gold which
produces

1
m.o 3
165 e2668d19ae58a8ab PREVAILING_DEF_IRONLY_EXP x
180 e2668d19ae58a8ab PREVAILING_DEF main
185 e2668d19ae58a8ab RESOLVED_DYN y

Reply via email to