[PATCH] Add ld.gold option "--dynamic-list-only"

Cary Coutant ccoutant@google.com
Tue Mar 11 17:45:00 GMT 2014

>> Have you looked at the --exclude-libs option?
> Yes.
> The problem is solve-able with exclude-libs, but I had to create
> pretty long list of excluded libraries which also need to be
> maintained.

You can say --exclude-libs=ALL.

> "default-visibility" switch doesn't solve the problem. Libraries that
> are linked use "__attribute__((visibility( default )))" even for
> static builds and this way appear in export list of final shared
> library and currently there is no way to override this.
> Or do you mean "default-visibility" is the way to specify visibility
> (set default) for "__attribute__((visibility( default )))"? I think in
> this case it should look like
> "--default-visibility={internal|hidden|protected|dynamic}" to avoid
> confusion about "default/default". So, in this case I will be able to
> specify "--default-visibility=hidden" and override what is necessary
> with dynamic list, right?

Yes, that's what I meant. I included "default" in the list simply
because that (unfortunately) is the name of the visibility, and the
option should allow you to specify all four values
(--default-visibility=default would be the default, and would be a way
to cancel/override an earlier use of the option).


More information about the Binutils mailing list