- To: aj@arthur.rhein-neckar.de
- Subject: Re: libc/936: glibc2 - ld.so fails to load a program defining it's own strcmp()
- From: Paul Pluzhnikov <paul@parasoft.com>
- Date: Sun, 14 Feb 99 18:48:55 PST
- Cc: bugs@gnu.org
- Delivery-date: Mon, 15 Feb 1999 07:46:29 +0100
- Envelope-to: aj@arthur.rhein-neckar.de
- Xref: arthur.rhein-neckar.de mail.gnats-libc-bugs:2574
>>>>> Andreas Jaeger writes:
> Hi Paul,
> the following patch is againt the just release glibc 2.1 and should
> fix the problem you've reported. I've recompiled glibc 2.1 with this
> patch and your test program works now.
> Could you please check the patch and tell us if everything works for
> you?
Sorry, it took me a while to get to this.
Yes, the `crash' program no longer crashes, but I still do not
think it works correctly (well the definition of "works correctly"
has been a subject of debate):
what's happening now is that the 'strcmp' definition in the executable
itself appears to be completely ignored, and the ld.so's (or maybe
libc.so's, I am not sure) definition is used instead, both at symbol
resolution (correct behaviour), and while the program runs (IMHO broken).
So, while the patch definitely fixes the "infinite recursion in ld.so"
(which is good), it would appear that it still denies me the ability to
iterposition my own special 'strcmp' ...
Since I do not understand how symbol versioning works, I can't
quite diagnose this further ...
Cheers,
P.S.
I presume you already know that glibc-2.1 fails to build on a
glibc-2.0.7-based Linux with messages like this:
make[1]: Leaving directory `/usr/src/redhat/SOURCES/glibc-2.1/db'
make -C db2 others
make[1]: Entering directory `/usr/src/redhat/SOURCES/glibc-2.1/db2'
cd /usr/src/redhat/SOURCES/g.2.1 && ar cruv libc_nonshared.a `cat csu/stamp.oS assert/stamp.oS ctype/stamp.oS db/stamp.oS db2/stamp.oS locale/stamp.oS intl/stamp.oS catgets/stamp.oS math/stamp.oS setjmp/stamp.oS signal/stamp.oS stdlib/stamp.oS stdio-common/stamp.oS libio/stamp.oS malloc/stamp.oS string/stamp.oS wcsmbs/stamp.oS time/stamp.oS dirent/stamp.oS grp/stamp.oS pwd/stamp.oS posix/stamp.oS io/stamp.oS termios/stamp.oS resource/stamp.oS misc/stamp.oS socket/stamp.oS sysvipc/stamp.oS gmon/stamp.oS gnulib/stamp.oS iconv/stamp.oS iconvdata/stamp.oS wctype/stamp.oS manual/stamp.oS shadow/stamp.oS md5-crypt/stamp.oS po/stamp.oS argp/stamp.oS linuxthreads/stamp.oS resolv/stamp.oS nss/stamp.oS localedata/stamp.oS timezone/stamp.oS rt/stamp.oS debug/stamp.oS inet/stamp.oS hesiod/stamp.oS sunrpc/stamp.oS nis/stamp.oS nscd/stamp.oS streams/stamp.oS login/stamp.oS elf/stamp.oS stamp.oS`
: /usr/src/redhat/SOURCES/g.2.1/libc_nonshared.a
gcc -nostdlib -nostartfiles -o /usr/src/redhat/SOURCES/g.2.1/db2/makedb -Wl,-dynamic-linker=3D/usr/local/lib/ld-linux.so.2 /usr/src/redhat/SOURCES/g.2.1/csu/crt1.o /usr/src/redhat/SOURCES/g.2.1/csu/crti.o `gcc --print-file-name=3Dcrtbegin.o` /usr/src/redhat/SOURCES/g.2.1/db2/makedb.o /usr/src/redhat/SOURCES/g.2.1/db2/libdb.so.3 -Wl,-rpath-link=3D/usr/src/redhat/SOURCES/g.2.1:/usr/src/redhat/SOURCES/g.2.1/math:/usr/src/redhat/SOURCES/g.2.1/elf:/usr/src/redhat/SOURCES/g.2.1/nss:/usr/src/redhat/SOURCES/g.2.1/nis:/usr/src/redhat/SOURCES/g.2.1/db2:/usr/src/redhat/SOURCES/g.2.1/rt:/usr/src/redhat/SOURCES/g.2.1/resolv:/usr/src/redhat/SOURCES/g.2.1/linuxthreads /usr/src/redhat/SOURCES/g.2.1/libc.so.6 /usr/src/redhat/SOURCES/g.2.1/libc_nonshared.a -lgcc `gcc --print-file-name=3Dcrtend.o` /usr/src/redhat/SOURCES/g.2.1/csu/crtn.o
/usr/src/redhat/SOURCES/g.2.1/libc.so.6: undefined reference to `__libc_cleanup_end'
collect2: ld returned 1 exit status
make[1]: *** [/usr/src/redhat/SOURCES/g.2.1/db2/makedb] Error 1
make[1]: Leaving directory `/usr/src/redhat/SOURCES/glibc-2.1/db2'
make: *** [db2/others] Error 2
--
Paul Pluzhnikov paul@parasoft.com
626/305-0041 x352