[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
glibc 2.2.4, atexit and libc_nonshared.a
From: |
Gérard Milmeister |
Subject: |
glibc 2.2.4, atexit and libc_nonshared.a |
Date: |
Thu, 8 Nov 2001 19:11:12 +0100 |
I have several libraries (like libXext.so.6.4) that are linked
against libc_nonshared.a (presumably because they need functions
not available in the shared C library), so that the symbol list
looks like this:
/usr/X11R6/lib/libXext.so:0000bcf0 T atexit
Now consider this trivial program using atexit:
#include <stdio.h>
#include <stdlib.h>
void print_exit(void)
{
printf("Hello\n");
}
int main()
{
atexit(print_exit);
}
If I link with "gcc atexit.c -o atexit" everything is perfect. ldd shows
this:
libc.so.6 => /lib/libc.so.6 (0x40033000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
If however I link with "gcc atexit.c /usr/X11R6/lib/libXext.so -o atexit"
the program hangs in the atexit function. It seemingly dynamically binds to
the atexit found in libXext.so.6 and not the one from libc.so.6.
I had no end of problems with software compiled that used the wrong
atexit.
--
Gérard Milmeister
Tannenrauchstr. 35
8038 Zürich
address@hidden
- glibc 2.2.4, atexit and libc_nonshared.a,
Gérard Milmeister <=