[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
a very unpleasant binutils-2.12.1 misfeature (bug)
From: |
Peter Breitenlohner |
Subject: |
a very unpleasant binutils-2.12.1 misfeature (bug) |
Date: |
Wed, 29 May 2002 16:17:40 +0200 (CEST) |
Hi,
I have just fetched and built (but not yet installed) the newest
binutils-2.12.1, in the hope that the new ld would resolve a problem caused
by glibc-2.2.5 (and 2.2.4 I think), but which is at least in part due to a
behaviour of ld which is somewhat hard to understand. Unfortunately, as far
as I can see the problem persists with the (not yet installed) new binutils.
According to Ulrich Drepper (glibc) this is `a bug in the linker', and he
advised me to `get a working linker'.
The situation (i686-gnu-linux) is as follows:
libX11.so.6.2 was created with
-soname libX11.so.6 -ldl -lc
and consequently 'objdump -p' displays
Dynamic Section:
NEEDED libdl.so.2
NEEDED libc.so.6
SONAME libX11.so.6
libc.so is actually a linker script containing
GROUP ( /lib/libc.so.6 /usr/lib/libc_nonshared.a )
if I link a program against -lX11, e.g.
gcc test.c -lX11
I get an error
/lib/libdl.so.2: undefined reference to `atexit'
but this error disapperas when I say
gcc test.c -lX11 -ldl
(just adding -lc doesn't help).
I think, the linker looks for unresolved symbols in the implicitly
included libdl.so AFTER using /usr/lib/libc_nonshared.a. This is a
misfeature (aka. bug), certainly so in the context of the newer glibc
I first thought all this was due to the fact that libX11 was created with an
earlier glibc version, but in fact the same kind of problem occurs with
other libraries I have recently built with glibc-2.2.5 (libpam*.so)
which also implicitly reference libdl and yield the same error
/lib/libdl.so.2: undefined reference to `atexit'
As to be expected, the whole problem disappears as soon as the test program
(test.c) explicitly references atexit.
As a temporary fix I have replaced the symlink libX11.so -> libX11.so.6.2
by a linker script containing
GROUP ( /usr/X11R6/lib/libX11.so.6 /lib/libdl.so.2 )
and similarly for the analogous cases, but this is a terrible nuisance.
Is there any chance that this problem will be addressed in the near future??
regards
Peter Breitenlohner <address@hidden>
- a very unpleasant binutils-2.12.1 misfeature (bug),
Peter Breitenlohner <=