bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: control of symbols exported by shared libraries


From: Simon Josefsson
Subject: Re: control of symbols exported by shared libraries
Date: Wed, 27 Jul 2005 15:06:42 +0200 (CEST)
User-agent: SquirrelMail/1.4.4

> Simon Josefsson wrote:
>> it appeared to me that a
>> preferable approach would be to fix libtool, and I thought that had
>> been done.  Joe Orton of RedHat even asked me to use Libtool's
>> --export-symbols-regex in GnuTLS, for instance.  I have been using it
>> all of my libraries for a long time.  No non-external symbols are
>> exported, from what I can tell.  Output below.
>
> You're right. For Linux systems, it has been fixed in revision 1.29 of
> libtool/m4/libtool.m4, on 2004-01-07, i.e. since libtool-1.5.2.

Ok.

> Still, this implementation of symbol export control optimizes only the
> symbol tables, and has no opportunity to optimize the code, because the
> compiler doesn't know which symbols will be exported when it compiles
> from .c to .lo.

I didn't completely buy/understand that argument.  I mean, the symbols
that are not intended to be exported should all be marked with "static"
anyway.  I'm travelling, but IIRC the paper had an example for this, and
it was some global variable 'int last' or something, which the compiler
couldn't be sure whether it was an external symbol or not, so it had to
assume the worst case (i.e., set it up as an external symbol).  I think
for my projects, that assumption isn't problematic, the global
variables/functions are exported.  If I'm not going to export them, I mark
them as static.  I'm probably missing something.  Internal helper
functions perhaps?

Regards,
Simon






reply via email to

[Prev in Thread] Current Thread [Next in Thread]