This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC] Hide autogenerated symbols when linking shared libraries
- From: Yuri Gribov <tetra2005 at gmail dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 3 May 2018 13:57:27 +0100
- Subject: Re: [RFC] Hide autogenerated symbols when linking shared libraries
- References: <CAJOtW+4ifhHp4R3z6pfD2bSaSOjh8hb3LafxFDdR8pbc3RysOg@mail.gmail.com> <2858374c-3652-add8-c785-6b409b99eee3@redhat.com> <CAJOtW+4+NpSq1aBVmsOPg=AFzFh+ddkFp5Nv==gdPHgeQQRO8g@mail.gmail.com> <eb9604a2-265b-81b6-58e6-ba2bd57a20c9@redhat.com>
On Thu, May 3, 2018 at 11:03 AM, Nick Clifton <nickc@redhat.com> wrote:
> Hi Yuri,
>
>> Ok, fair enough. Still let me point out that presently these symbols
>> pollute binary interfaces of any shared library compiled with default
>> flags by GNU/LLVM tools.
>
> Is it really a big problem though ? I would imagine that the amount of
> space used by these symbols is trivial compared to the size of the rest
> of any typical shared library.
Definitely not a big problem, more of a cosmetic issue.
>> Do you have any particular uses in mind? I tried grepping glibc,
>> binutils-gdb or libgcc for bss_start but couldn't find anything which
>> would justify them having default visibility...
>
> Not really - I was just speaking in generalities. It may well turn out
> that for, say x86_64 Linux based systems, these symbols are not needed.
> But I would be very wary of removing them without a lot of testing first
> as this is exactly the kind of thing that can break systems in unexpected,
> and unanticipated ways.
Sure, no arguing on that one.
>>> PS. You can always create your own linker script which does not define
>>> these symbols...
>>
>> Thanks but I'm more worried about distros (I came across them while
>> investigating redundant symbols exported by Debian packages). Asking
>> every package maintainer to use -Wl,--version-script won't scale very
>> well...
>
> True. :-) Although some distros due do use special packages that provide
> the default linker command line options when building applications (and
> libraries). EG Fedora's redhar-rpm-config package. So you could make a
> change only in this package and have it affect most apps.
Nice, will keep that in mind!
-Y