This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold][patch] Fix warning about refs to hidden symbols from shared libs
- From: Ian Lance Taylor <iant at google dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 18 Aug 2009 17:00:35 -0700
- Subject: Re: [gold][patch] Fix warning about refs to hidden symbols from shared libs
- References: <c17be2b30908181120y6a15e3c4w7840a1f529126b45@mail.gmail.com>
Cary Coutant <ccoutant@google.com> writes:
> * resolve.cc (Symbol_table::resolve): Don't complain about defined
> symbols in shared libraries overridden by hidden or internal symbols
> in the main program.
>
>
> Index: resolve.cc
> ===================================================================
> RCS file: /cvs/src/src/gold/resolve.cc,v
> retrieving revision 1.41
> diff -u -p -r1.41 resolve.cc
> --- resolve.cc 12 Aug 2009 18:30:39 -0000 1.41
> +++ resolve.cc 18 Aug 2009 18:10:21 -0000
> @@ -257,8 +257,10 @@ Symbol_table::resolve(Sized_symbol<size>
> // Record that we've seen this symbol in a regular object.
> to->set_in_reg();
> }
> - else if (to->visibility() == elfcpp::STV_HIDDEN
> - || to->visibility() == elfcpp::STV_INTERNAL)
> + else if (is_ordinary
> + && st_shndx == elfcpp::SHN_UNDEF
> + && (to->visibility() == elfcpp::STV_HIDDEN
> + || to->visibility() == elfcpp::STV_INTERNAL))
> {
> // A dynamic object cannot reference a hidden or internal symbol
> // defined in another object.
Strictly speaking it is not necessary to check is_ordinary when
comparing with SHN_UNDEF. However, it does no harm.
This is OK.
Thanks.
Ian