Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 42046 - binutils ld crashes with BFD 2.14.90.0.8 20040114 assertion fail elflink.h:4487
Summary: binutils ld crashes with BFD 2.14.90.0.8 20040114 assertion fail elflink.h:4487
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High minor (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-18 10:29 UTC by Martijn Koster
Modified: 2005-05-07 18:20 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martijn Koster 2004-02-18 10:29:55 UTC
If I manually compile an un-patched cdb-0.75, ld crashes.


Reproducible: Always
Steps to Reproduce:
1. tar xvzf /usr/portage/distfiles/cdb-0.75.tar.gz
2. cd cdb-0.75
3. make
Actual Results:  
./load cdbget cdb.a buffer.a unix.a byte.a 
collect2: ld terminated with signal 11 [Segmentation fault] 
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../../i686-pc-linux-gnu/bin/ld: 
BFD 2.14.90.0.8 20040114 assertion fail elflink.h:4487 
 

Expected Results:  
ld should report errors, like so: 
 
./load cdbget cdb.a buffer.a unix.a byte.a 
cdb.a(cdb.o)(.text+0x10e): In function `cdb_read': 
: undefined reference to `errno' 
cdb.a(cdb.o)(.text+0x18b): In function `cdb_read': 
: undefined reference to `errno' 
buffer.a(strerr_sys.o)(.text+0x9): In function `strerr_sysinit': 
: undefined reference to `errno' 
buffer.a(buffer_put.o)(.text+0x47): In function `allwrite': 
: undefined reference to `errno' 
collect2: ld returned 1 exit status 
make: *** [cdbget] Error 1 
 
(this is from another gentoo box, running 2.6.0-gentoo (non-nptl), gcc 3.3.2 
20031218, glibc 2.3.2-r9, binutils 2.14.90.0.7-r4) 

This is with 2.6 kernel, nptl, and ~x86 gcc/glibc/binutils. 
 
Note that this is not a duplicate of 16267 -- I know cdb needs errno 
patches. But ld should assert. 
 
It's possible this is a "duplicate" of the 20600 meta compilation bug. 
My hardware is fine; this problem only started after I migrated to 
2.6 and the new compiler tools.  
 
Full config info: 
 
$ emerge info 
Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.3_pre20040207-r0, 
2.6.2-gentoo-r1) 
================================================================= 
System uname: 2.6.2-gentoo-r1 i686 Intel(R) Pentium(R) 4 CPU 2.00GHz 
Gentoo Base System version 1.4.3.13 
distcc 2.11.1 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) 
[enabled] 
ccache version 2.3 [enabled] 
Autoconf: sys-devel/autoconf-2.58-r1 
Automake: sys-devel/automake-1.7.7 
ACCEPT_KEYWORDS="x86" 
AUTOCLEAN="yes" 
CFLAGS="-O2 -mcpu=i686 -pipe" 
CHOST="i686-pc-linux-gnu" 
COMPILER="gcc3" 
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/share/config /var/qmail/alias /var/qmail/control" 
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d" 
CXXFLAGS="-O2 -mcpu=i686 -pipe" 
DISTDIR="/usr/portage/distfiles" 
FEATURES="autoaddcvs ccache distcc sandbox" 
GENTOO_MIRRORS="http://www.mirror.ac.uk/sites/www.ibiblio.org/gentoo/" 
MAKEOPTS="-j4" 
PKGDIR="/usr/portage/packages" 
PORTAGE_TMPDIR="/var/tmp" 
PORTDIR="/usr/portage" 
PORTDIR_OVERLAY="" 
SYNC="rsync://rsync.uk.gentoo.org/gentoo-portage" 
USE="X alsa apm arts avi berkdb bonobo cdr crypt cups encode esd foomaticdb 
gdbm gif gnome gphoto2 gpm gtk gtk2 gtkhtml guile imlib java jpeg kde ldap 
libg++ libwww mad mikmod motif mozilla mpeg ncurses nls nptl oggvorbis opengl 
oss pam pdflib perl png python qt quicktime readline sdl slang spell ssl svga 
tcltk tcpd tiff truetype x86 xml2 xmms xv zlib" 
 
$ gcc --version 
gcc (GCC) 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, propolice-3.3-7) 
Copyright (C) 2003 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions.  There is NO 
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 
$ /lib/libc.so.6 
GNU C Library stable release version 2.3.3, by Roland McGrath et al. 
Copyright (C) 2004 Free Software Foundation, Inc. 
This is free software; see the source for copying conditions. 
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE. 
Compiled by GNU CC version 3.3.2 20031218 (Gentoo Linux 3.3.2-r5, 
propolice-3.3-7). 
Compiled on a Linux 2.6.1 system on 2004-02-17. 
Available extensions: 
        GNU libio by Per Bothner 
        crypt add-on version 2.1 by Michael Glad and others 
        NPTL 0.60 by Ulrich Drepper 
        BIND-8.2.3-T5B 
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk 
Thread-local storage support included. 
Report bugs using the `glibcbug' script to <bugs@gnu.org>. 
 
$ ACCEPT_KEYWORDS="~x86" emerge -p gcc glibc binutils 
[ebuild     U ] sys-devel/gcc-3.3.2-r7 [3.3.2-r5] 
[ebuild   R   ] sys-libs/glibc-2.3.3_pre20040207 
[ebuild   R   ] sys-devel/binutils-2.14.90.0.8
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-19 12:41:35 UTC
Can you try with distcc disabled?
Comment 2 Martijn Koster 2004-02-19 14:37:22 UTC
Same thing.

  export PATH=/bin:/usr/bin:/usr/local/bin:/usr/i686-pc-linux-gnu/gcc-bin/3.3
  hash -r
  rm *.o *.a
  make
  ...
  collect2: ld terminated with signal 11 [Segmentation fault]
  /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/../../../../i686-pc-linux-gnu/bin/ld:   
  BFD 2.14.90.0.8 20040114 assertion fail elflink.h:4505

Note that the assertion line number is different, that's because I updated binutils to 2.14.90.0.8-r1.
Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2004-02-26 09:21:39 UTC
Works fine here.  What about if you merge the one in portage?
Comment 4 Martijn Koster 2004-02-26 13:14:00 UTC
By "the one in portage" you mean cdb? That works fine;
portage applies a patch that fixes errno, so there is no error for
ld to report (or in my case crash on).

What versions of gcc/glibc/binutils/kernel are you running?
Comment 5 Martijn Koster 2004-03-25 03:27:09 UTC
Minimal reproduction:

$ echo "extern int errno; int main() { int x = errno; }" > s.c
$ /usr/bin/gcc -c s.c
$ /usr/bin/gcc -o s s.o
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/../../../../i686-pc-linux-gnu/bin/ld: BFD 2.14.90.0.8 20040114 assertion fail elflink.h:4505
Comment 6 Patrick McLean gentoo-dev 2004-04-07 22:17:49 UTC
I get (probably the same bug) trying to compile the 2.6.4 user-mode-linux sources.


Bumping up the severity a bit, this is probably not a good thing to have around for too long.

/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.3/../../../../i686-pc-linux-gnu/bin/ld: BFD 2.14.90.0.8 20040114 assertion fail elf.c:3465
Comment 7 AquaRapid 2004-05-09 15:35:05 UTC
Ran into this trying to compile a 2.6 UML kernel too.  However, this seems to be gcc-related, rather than binutils/ld.  I base this on the fact that the minimal example doesn't trigger the assertion on Fedora core 2 test 2, but when using the Fedora binutils on Gentoo, the same (ok, very similar, the line number reported is different) problem ensues.   So I suspect gcc (I've tried Gentoo gcc-3.3.3-r3 and r4) is the culprit.
Comment 8 Bill Kenworthy 2004-07-27 02:20:26 UTC
Me too!
Basic problem is I cant load any modules as module-init-tools wont build so I had too build a monlithic kernel to boot - as this is my gateway machine I need to fix it.  Any hints short of a reinstall welcome.  

This machine was originally built as a a gentoo 1.1a a couple of years back, and is currently an up to date default-1.4 profile (upgraded each major change).  I recently changed the cpu from a cyrix 686 to a k6-2, first recompiling the whole system down to a 586 before swapping MB/CPU.  Worked fine, so I then changed to a 2.6.7 gentoo-dev-sources/udev with no problems.  After changing the CFLAGS to k6-2, and building some 200 packages, this problem occurred which has stopped me dead.  So far I have cleaned ccache out and recompiled glibc/binutils/gcc

gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"module-init-tools\" -DVERSION=\"
3.0\" -DCONFIG_USE_ZLIB=1  -I. -I.     -march=k6-2 -O2 -pipe -fomit-frame-pointer -Wunused -Wall -c `test -f 'modinfo.c' || echo './'`modinfo.c
gcc  -march=k6-2 -O2 -pipe -fomit-frame-pointer -Wunused -Wall   -o insmod.static -static insmod.o
gcc  -march=k6-2 -O2 -pipe -fomit-frame-pointer -Wunused -Wall   -o lsmod  lsmod.o -Wl,-Bstatic -lz -Wl,-Bdynamic
gcc  -march=k6-2 -O2 -pipe -fomit-frame-pointer -Wunused -Wall   -o insmod  insmod.o -Wl,-Bstatic -lz -Wl,-Bdynamic
gcc  -march=k6-2 -O2 -pipe -fomit-frame-pointer -Wunused -Wall   -o modprobe  modprobe.o zlibsupport.o -Wl,-Bstatic -lz -Wl,-Bdynamic
gcc  -march=k6-2 -O2 -pipe -fomit-frame-pointer -Wunused -Wall   -o rmmod  rmmod.o -Wl,-Bstatic -lz -Wl,-Bdynamic
gcc  -march=k6-2 -O2 -pipe -fomit-frame-pointer -Wunused -Wall   -o depmod  depmod.o moduleops.o tables.o zlibsupport.o -Wl,-Bstatic -lz -Wl,-Bdynamic
gcc  -march=k6-2 -O2 -pipe -fomit-frame-pointer -Wunused -Wall   -o modinfo  modinfo.o zlibsupport.o -Wl,-Bstatic -lz -Wl,-Bdynamic
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.3/../../../../i586-pc-linux-gnu/bin/ld: BFD 2.14.90.0.8 20040114 assertion fail elflink.h:4505
distcc[4501] ERROR: compile on localhost failed
make: *** [modprobe] Error 1
make: *** Waiting for unfinished jobs....
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.3/../../../../i586-pc-linux-gnu/bin/ld: BFD 2.14.90.0.8 20040114 assertion fail elflink.h:4505
distcc[4514] ERROR: compile on localhost failed
make: *** [depmod] Error 1
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/lib/gcc-lib/i586-pc-linux-gnu/3.3.3/../../../../i586-pc-linux-gnu/bin/ld: BFD 2.14.90.0.8 20040114 assertion fail elflink.h:4505
distcc[4521] ERROR: compile on localhost failed
make: *** [modinfo] Error 1
                                                                                                                                                                                                    
!!! ERROR: sys-apps/module-init-tools-3.0-r2 failed.
!!! Function src_compile, Line 89, Exitcode 2
!!! emake module-init-tools failed

moriah root # emerge info
Portage 2.0.50-r9 (default-x86-1.4, gcc-3.3.3, glibc-2.3.3.20040420-r0,2.2.5-r4, 2.6.7-gentoo-r11)
=================================================================
System uname: 2.6.7-gentoo-r11 i586 AMD-K6(tm) 3D processor
Gentoo Base System version 1.4.16
distcc 2.13 i586-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.3
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=k6-2 -O2 -pipe -fomit-frame-pointer"
CHOST="i586-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/
defaults/pref /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/
config/ /usr/share/texmf/xdvi/ /var/bind /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=k6-2 -O2 -pipe -fomit-frame-pointer"
DISTDIR="/home/distfiles"
FEATURES="autoaddcvs ccache distcc sandbox"
GENTOO_MIRRORS="rsync://rattus.localdomain/portage"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/home/portage-tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X apache2 apm atlas berkdb bonobo crypt cscope cups curl dga directfb dnd encode esd ethereal evo fam fastcgi foomaticdb gd gdbm gif gnome gnomedb gphoto2 g
pm gtk gtk2 gtkhtml guile imap imlib java jpeg libg++ libgda libwww linguas_en_AU maildir mdb mikmod mmx motif mozctl mozilla mozinterfaceinfo moznoirc moznomail
 moznoxft mozp3p mozsvg mozxmlterm mpeg mpeg4 mplayer mysql ncurses nptl odbc oggvorbis opengl openssh oss pam pdflib perl php pic plotutils png pnp ppds python
readline samba sdl sis slang slp spell ssl svga tcltk tcpd tetex tiff transparent-proxy truetype trusted type1 usb uudeview wavelan wmf x86 xface xml xml2 xmms x
randr xv zlib"
Comment 9 SpanKY gentoo-dev 2005-05-07 18:20:26 UTC
seems to be fixed with newer binutils ... 2.15.94+