severity 211610 wishlist reassign 211610 glibc thanks At Thu, 18 Sep 2003 18:17:42 -0500, Andrés Roldán wrote: > When trying to executing a binary with the __thread keywork, the program > segfaults. Below is the output. > > [pts/0] > [EMAIL PROTECTED]:~$ cat tls.c > __thread int a; > > int > main (void) > { > return a; > } > [pts/0] > [EMAIL PROTECTED]:~$ gcc-3.3 -Wall -o tls tls.c > [pts/0] > [EMAIL PROTECTED]:~$ ./tls > Segmentation fault (core dumped) > [pts/0] > [EMAIL PROTECTED]:~$ gdb tls core > GNU gdb 5.3.90_2003-08-24-cvs-debian > Copyright 2003 Free Software Foundation, Inc. > GDB is free software, covered by the GNU General Public License, and you are > welcome to change it and/or distribute copies of it under certain conditions. > Type "show copying" to see the conditions. > There is absolutely no warranty for GDB. Type "show warranty" for details. > This GDB was configured as "i386-linux"...(no debugging symbols found)... > Core was generated by `./tls'. > Program terminated with signal 11, Segmentation fault. > Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done. > Loaded symbols for /lib/libc.so.6 > Reading symbols from /lib/ld-linux.so.2...(no debugging symbols found)...done. > Loaded symbols for /lib/ld-linux.so.2 > #0 0x08048344 in main () > (gdb) disas main > Dump of assembler code for function main: > 0x08048334 <main+0>: push %ebp > 0x08048335 <main+1>: mov %esp,%ebp > 0x08048337 <main+3>: sub $0x8,%esp > 0x0804833a <main+6>: and $0xfffffff0,%esp > 0x0804833d <main+9>: mov $0x0,%eax > 0x08048342 <main+14>: sub %eax,%esp > 0x08048344 <main+16>: mov %gs:0x0,%eax
This is because glibc's dl does not support tls currently on i386, so %gs:0 does not setup correctly for this purpose. Regards, -- gotom