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 internal error with --start-lib and object file with no global syms


Cary Coutant <ccoutant@google.com> writes:

>         * archive.cc (Lib_group::add_symbols): Lock object before deleting its
>         symbols data.
>         (Lib_group::include_member): Unlock object after deleting its
>         symbols data.
>         * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
>         the bug fixed here.
>
> Index: archive.cc
> ===================================================================
> RCS file: /cvs/src/src/gold/archive.cc,v
> retrieving revision 1.57
> diff -u -p -r1.57 archive.cc
> --- archive.cc	20 Aug 2010 00:35:12 -0000	1.57
> +++ archive.cc	23 Aug 2010 18:13:49 -0000
> @@ -1057,7 +1057,14 @@ Lib_group::add_symbols(Symbol_table* sym
>            else
>              {
>                if (member.sd_ != NULL)
> -                delete member.sd_;
> +		{
> +		  // The file must be locked in order to destroy the views
> +		  // associated with it.
> +		  gold_assert (obj != NULL);
> +		  obj->lock(this->task_);
> +		  delete member.sd_;
> +		  obj->unlock(this->task_);
> +		}

Remove space before left parenthesis in gold_assert line.

This is OK with that change.

Thanks for sorting this out.

Ian


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