This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold patch] Fix internal error with --start-lib and object file with no global syms
- 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: Mon, 23 Aug 2010 12:13:14 -0700
- Subject: Re: [gold patch] Fix internal error with --start-lib and object file with no global syms
- References: <AANLkTimRi6BtdbE0r1au7v077HTMmC5TAfN73PB3cGuT@mail.gmail.com>
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