Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 83491 - ld 2.15.92.0.2 segfaults when using errno, but header is not included
Summary: ld 2.15.92.0.2 segfaults when using errno, but header is not included
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
: 102515 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-02-27 12:17 UTC by Oliver Battenfeld
Modified: 2005-08-14 19:45 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 Oliver Battenfeld 2005-02-27 12:17:41 UTC
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).
Comment 1 SpanKY gentoo-dev 2005-04-27 15:09:26 UTC
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
Comment 2 SpanKY gentoo-dev 2005-08-14 19:45:54 UTC
*** Bug 102515 has been marked as a duplicate of this bug. ***