This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: [Paul Pluzhnikov <paul@parasoft.com>] Re: libc/936: glibc2 - ld.so fails to load a program defining it's own strcmp()
- To: libc-hacker@cygnus.com
- Subject: Re: [Paul Pluzhnikov <paul@parasoft.com>] Re: libc/936: glibc2 - ld.so fails to load a program defining it's own strcmp()
- From: Andreas Jaeger <aj@arthur.rhein-neckar.de>
- Date: 15 Feb 1999 20:12:18 +0100
- Cc: Paul Pluzhnikov <paul@parasoft.com>
- Mail-Copies-To: never
- References: <u81zjsku9l.fsf@arthur.rhein-neckar.de> <r26793ehip.fsf@happy.cygnus.com>
>>>>> Ulrich Drepper writes:
Ulrich> Andreas Jaeger <aj@arthur.rhein-neckar.de> writes:
>> I just got this email. Paul seems to be right, his program doesn't
>> crash anymore since glibc's strcmp is always used.
Ulrich> The current behaviour is exactly how it has to be done.
Ok, I've rewritten the test program and it works now for me:
$ LD_LIBRARY_PATH=/usr/glibc/glibc-2.1/lib /usr/glibc/glibc-2.1/lib/ld-linux.so.2 ./crash
there
here -1
Paul, I really think that's ok now. What do you think?
Andreas
/* no need to even call strcmp -- ld.so will do that for you */
int strcmp(char *a, char *b)
{
printf("there\n");
while(*a && *b) {
if (*a < *b) {
return -1;
} else if (*a > *b) {
return 1;
}
a++; b++;
}
if (*a == '\0' && *b == '\0')
return 0;
return *a < *b;
}
int
main()
{
printf("here %d\n", strcmp ("a", "b"));
return 0;
}
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de