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: [gold][patch] Fix warning about refs to hidden symbols from shared libs


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


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