This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: bfd assertion fail elflink.h:1566
- To: patha at ida dot liu dot se
- Subject: Re: bfd assertion fail elflink.h:1566
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 8 Oct 1999 18:11:45 -0400
- CC: binutils at sourceware dot cygnus dot com, biedie at my-Deja dot com
- References: <199910072330.BAA12130@portofix.ida.liu.se>
Date: Fri, 08 Oct 1999 01:30:35 +0200
From: Patrik Hagglund <patha@ida.liu.se>
Date: Wed, 06 Oct 1999 05:59:45 -0700
From: " " <biedie@my-Deja.com>
I have currently installed gcc 2.95.1 and binutils 2.9.5.0.14.
My system is solaris2.6. I get the following warning/error:
/some_dir/sparc-sun-solaris2.6/bin/ld: bfd assertion fail elflink.h:1566
I had the same problem (symptom).
I checked in a patch which I think should fix the problem. However, I
did not test your actual test case--I tested another one which was
sent to me.
I've appended the patch.
Using Sun's ld gives the following error messages:
ld: Software Generation Utilities - Solaris/ELF (3.0)
ld: warning: file ./libgcj.so: section .stabstr: malformed string table, initial or final byte
ld: warning: file ./libgcjgc.so: section .stabstr: malformed string table, initial or final byte
ld: warning: file ./libzgcj.so: section .stabstr: malformed string table, initial or final byte
I'm not sure what's up with this. I very much doubt that it is
related to the assertion failure.
Were those shared libraries created by the GNU linker? What is the
initial and final byte of the .stabstr section in those files? (You
can get this using objdump -s -j .stabstr). If you create the files
using the Solaris linker, what is the initial and final byte of the
.stabstr section? (You may need to use a special option to force the
Solaris linker to create a .stabstr section rather than leaving the
stabs information in the .o files). Perhaps the Solaris linker
expects something which the GNU linker simply isn't doing.
Ian
Index: elflink.h
===================================================================
RCS file: /cvs/binutils/binutils/bfd/elflink.h,v
retrieving revision 1.34
diff -u -p -r1.34 elflink.h
--- elflink.h 1999/09/10 04:22:23 1.34
+++ elflink.h 1999/10/08 15:21:07
@@ -683,8 +683,12 @@ elf_merge_symbol (abfd, info, name, sym,
/* To make this work we have to frob the flags so that the rest
of the code does not think we are using the regular
definition. */
- h->elf_link_hash_flags &= ~ ELF_LINK_HASH_DEF_REGULAR;
- h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR;
+ else if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) != 0)
+ h->elf_link_hash_flags |= ELF_LINK_HASH_REF_DYNAMIC;
+ h->elf_link_hash_flags &= ~ (ELF_LINK_HASH_DEF_REGULAR
+ | ELF_LINK_HASH_DEF_DYNAMIC);
/* If H is the target of an indirection, we want the caller to
use H rather than the indirect symbol. Otherwise if we are