This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [cross-binutils-2.15.91.0.2] assertion fail linker.c:619
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Pawe?? Sikora <pluto at pld-linux dot org>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 17 Aug 2004 15:16:10 -0700
- Subject: Re: [cross-binutils-2.15.91.0.2] assertion fail linker.c:619
- References: <200408171142.21199.pluto@pld-linux.org>
On Tue, Aug 17, 2004 at 11:42:20AM +0200, Pawe?? Sikora wrote:
> Hi,
>
> I have a minor problem during with kernel cross compilation.
> The cross linker reports an error but kernel works fine.
>
> # make ARCH=x86_64 CROSS_COMPILE=amd64-pld-linux-
> (...)
> LD ?? ?? ??vmlinux
> amd64-pld-linux-ld: BFD 2.15.91.0.2 20040727 assertion fail linker.c:619
> (...)
>
> Any ideas?
>
> # crossamd64-binutils-2.15.91.0.2-1
> # crossamd64-gcc-3.4.2-0.20040806.1
> # glibc-2.3.4-0.20040722.2+nptl
>
This is a linker bug:
http://sources.redhat.com/bugzilla/show_bug.cgi?id=338
The problem is bfd_link_add_undef assumes h->und_next == NULL. But it
may not be true in all cases, depending on how lucky/unlucky you are.
This patch seems to fix the testcase. But I am not sure if it is 100%
correct.
H.J.
--
--- linker.c.undef 2004-08-13 08:00:10.000000000 -0700
+++ linker.c 2004-08-17 15:14:00.595475841 -0700
@@ -616,7 +616,7 @@ void
bfd_link_add_undef (struct bfd_link_hash_table *table,
struct bfd_link_hash_entry *h)
{
- BFD_ASSERT (h->und_next == NULL);
+ BFD_ASSERT (h->und_next == NULL || h->und_next == table->undefs_tail);
if (table->undefs_tail != NULL)
table->undefs_tail->und_next = h;
if (table->undefs == NULL)