On Wed, Feb 18, 2026 at 05:05:24PM +0100, Rainer Orth wrote:
> I don't think so: the Solaris linker mapfiles are completely different
> from GNU ld ones:
> 
> https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/linkers-libraries/mapfiles-link-editor.html
> 
> However, -z discard-unused=files should be able to achieve the same
> effect, only globally and not restricted to a single dependency:
> 
> https://docs.oracle.com/en/operating-systems/solaris/oracle-solaris/11.4/linkers-libraries/removing-unused-material.html

I think it is intentional that if user writes -latomic explicitly, then it
isn't ignored unless using -Wl,-z,ignore explicitly on the command line.

> I wonder why it's desirable to restrict --as-needed to a single library
> in this case.

It means that all the libraries later on the command line are not as-needed,
even when user used -Wl,-z,ignore on the command line.
With libatomic_asneeded.so or --push-state --as-needed -latomic --pop-state
that particular occurrence of -latomic is --as-needed regardless of
everything else, the rest follows what user asked for.

        Jakub

Reply via email to