This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug dynamic-link/14370] ld.so crashes on mismatched TLS/non-TLS symbols
- From: "hjl.tools at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Tue, 04 Sep 2012 19:09:38 +0000
- Subject: [Bug dynamic-link/14370] ld.so crashes on mismatched TLS/non-TLS symbols
- Auto-submitted: auto-generated
- References: <bug-14370-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=14370
H.J. Lu <hjl.tools at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
CC| |hjl.tools at gmail dot com
Resolution|INVALID |
Summary|SIGFPE in 'ldd -r' |ld.so crashes on mismatched
| |TLS/non-TLS symbols
--- Comment #15 from H.J. Lu <hjl.tools at gmail dot com> 2012-09-04 19:09:38 UTC ---
I don't think ld.so should crash on bad DSO built with the
old/bad glibc/binutils:
[hjl@gnu-6 pr14370]$ cat x.c
#if 0
#include <errno.h>
#else
int errno = 3;
#endif
int
bar (void)
{
errno = 4;
return errno;
}
[hjl@gnu-6 pr14370]$ cat main.c
#include <stdio.h>
#include <dlfcn.h>
int
main ()
{
void *handle;
int (*func)();
handle = dlopen ("./libfoo.so", RTLD_LAZY);
if (!handle)
{
fprintf (stderr, "%s\n", dlerror());
return 1;
}
func = dlsym (handle, "bar");
if (func == NULL)
{
fprintf (stderr, "%s\n", dlerror());
return 1;
}
printf ("errno: %d\n", func ());
dlclose (handle);
return 0;
}
[hjl@gnu-6 pr14370]$ make GLIBC-DIR= run.dynamic
gcc -m32 -c -o main.o main.c
gcc -m32 -o dynamic main.o -ldl
gcc -m32 -c -o x.o x.c
./ld -m elf_i386 -shared -o libfoo.so x.o -lm
./dynamic
make: *** [run.dynamic] Segmentation fault
[hjl@gnu-6 pr14370]$
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.