ld (sys-devel/binutils 2.15.92.0.2-r4) crashes with signal 11, when compiling code that uses errno, if the header file is not included. Reproducible: Always Steps to Reproduce: 1. The following C code sample will reproducibly provoke the crash: extern int errno; int main() { return errno; } 2. gcc codesample.c Actual Results: collect2: ld terminated with signal 11 [Segmentation fault] /usr/lib/gcc/i686-pc-linux-gnu/3.4.3/../../../../i686-pc-linux-gnu/bin/ld: BFD 2.15.92.0.2 20040927 assertion fail /var/tmp/portage/binutils-2.15.92.0.2-r4/work/binutils-2.15.92.0.2 \ /bfd/elflink.c:6141 Expected Results: Expected behaviour would probably be an undefined reference (it even compiles without error on Debian systems).
the reason it 'compiles without error' on a debian system is because they're still using pretty old versions of glibc ... errno behavior in glibc was changed a while ago and gentoo has been using that version for quite some time this issue seems to be resolved in newer versions of binutils ... binutils-2.15.92.0.2-r8 still crashes, but binutils-2.15.97 and binutils-2.16.90.0.1 produce this: $ gcc test.c /usr/lib/gcc/x86_64-pc-linux-gnu/3.4.3-20050110/../../../../x86_64-pc-linux-gnu/bin/ld: errno: TLS definition in /lib/libc.so.6 section .tbss mismatches non-TLS reference in /tmp/ccYBuboH.o /lib/libc.so.6: could not read symbols: Bad value collect2: ld returned 1 exit status since this isnt a critical failure in our current stable binutils, and the next version that we move to will have this fixed, i'll just mark this issue as resolved
*** Bug 102515 has been marked as a duplicate of this bug. ***