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: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>, Ian Lance Taylor <iant at google dot com>
- Date: Fri, 27 Aug 2010 09:09:57 -0700
- Subject: Re: [gold patch] Fix internal error with --start-lib and object file with no global syms
- References: <AANLkTimRi6BtdbE0r1au7v077HTMmC5TAfN73PB3cGuT@mail.gmail.com>
On Mon, Aug 23, 2010 at 11:23 AM, Cary Coutant <ccoutant@google.com> wrote:
> If gold encounters an object file between --start-lib and --end-lib
> that has no global symbols, it will trigger an assertion failure due
> to a failure to lock the file before destroying the views in that
> file. This patch fixes that problem and tweaks the --start-lib test
> case to trigger the problem.
>
> OK?
>
> -cary
>
> ? ? ? ?* 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.
>
Hi Cary,
Your patch changed testsuite/start_lib_test_3.c to
static char t3[] = "t3";
I got
cc1: warnings being treated as errors
/net/gnu-6/export/linux/src/binutils/binutils/gold/testsuite/start_lib_test_3.c:25:
warning: ‘t3’ defined but not used
and this test failed.
--
H.J.