This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linker exposing private symbols


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]