This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Linker exposing private symbols
- From: Jeffrey Walton <noloader at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 27 Aug 2018 07:38:20 -0400
- Subject: Re: Linker exposing private symbols
- References: <CAH8yC8m5obs+uMMC0oVy-HMkbpAZz319fpkigxTGsnm=eX0hfA@mail.gmail.com> <20180827020613.GA10048@bubble.grove.modra.org>
- Reply-to: noloader at gmail dot com
On Sun, Aug 26, 2018 at 10:06 PM, Alan Modra <amodra@gmail.com> wrote:
> On Sun, Aug 26, 2018 at 04:22:46PM -0400, Jeffrey Walton wrote:
>> I have two questions. First, why doesn't the toolchain honor the
>> visibility request (why do I need --exclude-libs)? I uess another way
>> to put it is, how can symbols be re-exported if they are private?
>
> What makes you think the toolchain is misbehaving? Your visibility
> command line options affect the code you are compiling, but you of
> course are linking against other object files as well.
Thanks Alan.
I feel like the toolchain is misbehaving because I asked for 2 symbols
to be exported but that did not happen.
There's nothing special about me. Others have encountered the same,
like https://stackoverflow.com/q/2222162/608639 and
https://stackoverflow.com/q/37934388/608639 .
I'll have to think about things some more. Maybe the complaint is, we
asked GCC to ensure 2 symbols were exported (and the rest private) but
GCC did not fulfill the request when it drove link. I may be splitting
too many hairs, though.
> Maybe all the
> symbols that seem unexpected to you come from libcryptopp.a or libc?
Yes, the symbols are from the archives.
>> Second, why is ALL case sensitive (and without a diagnostic)?
>
> Seems good to me. You asked ld to exclude All.a symbols.
Just to play devils advocate... I don't have a library ALL.a either.
Jeff