[hjl@gnu strip]$ cat foo.c extern __thread int foo; int bar () { return foo; } [hjl@gnu strip]$ gcc -c foo.c [hjl@gnu strip]$ readelf -s foo.o Symbol table '.symtab' contains 10 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FILE LOCAL DEFAULT ABS foo.c 2: 00000000 0 SECTION LOCAL DEFAULT 1 3: 00000000 0 SECTION LOCAL DEFAULT 3 4: 00000000 0 SECTION LOCAL DEFAULT 4 5: 00000000 0 SECTION LOCAL DEFAULT 5 6: 00000000 0 SECTION LOCAL DEFAULT 6 7: 00000000 13 FUNC GLOBAL DEFAULT 1 bar 8: 00000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_ 9: 00000000 0 TLS GLOBAL DEFAULT UND foo [hjl@gnu strip]$ strip -g foo.o [hjl@gnu strip]$ readelf -s foo.o Symbol table '.symtab' contains 9 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 SECTION LOCAL DEFAULT 1 2: 00000000 0 SECTION LOCAL DEFAULT 3 3: 00000000 0 SECTION LOCAL DEFAULT 4 4: 00000000 0 SECTION LOCAL DEFAULT 5 5: 00000000 0 SECTION LOCAL DEFAULT 6 6: 00000000 13 FUNC GLOBAL DEFAULT 1 bar 7: 00000000 0 NOTYPE GLOBAL DEFAULT UND _GLOBAL_OFFSET_TABLE_ 8: 00000000 0 NOTYPE GLOBAL DEFAULT UND foo
Subject: Re: New: strip doesn't presever TLS type Hi HJ, > [hjl@gnu strip]$ gcc -c foo.c > [hjl@gnu strip]$ readelf -s foo.o > [hjl@gnu strip]$ strip -g foo.o > [hjl@gnu strip]$ readelf -s foo.o I just tried this procedure and ended up with a stripped foo.o that still has a symbol "foo" with the TLS type. I was using today's GCC and BINUTILS sources and an i686-pc-linux-gnu target running natively. In what environment did you reproduce this problem ? Cheers Nick
Fixed by http://sources.redhat.com/ml/binutils/2004-11/msg00332.html