ChokkaUoM / address-sanitizer

Automatically exported from code.google.com/p/address-sanitizer
0 stars 0 forks source link

ASan is unable to link TLS arrays #394

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
To reproduce:
$ cat tls.cc 
__thread int glob[10];
int main(int argc, char **argv) {
  return 0;
}

clang++ tls.cc -fsanitize=address -o tls 
/usr/bin/ld: glob: TLS definition in /tmp/tls-be8082.o section .tbss mismatches 
non-TLS definition in 
/usr/local/google/src/chrome/src/third_party/llvm-build/Release+Asserts/bin/../l
ib/clang/3.7.0/lib/linux/libclang_rt.asan-x86_64.a(asan_interceptors.cc.o) 
section .text
/tmp/tls-be8082.o: error adding symbols: Bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Original issue reported on code.google.com by ramosian.glider@gmail.com on 17 Jun 2015 at 2:59

GoogleCodeExporter commented 9 years ago
Huh? You have an ODR violation - "glob" TLS array and "glob" function from 
libc, for which we provide the interceptor. Renaming to "glob2" makes the error 
go away.

Original comment by samso...@google.com on 17 Jun 2015 at 6:45

GoogleCodeExporter commented 9 years ago
Yeah, sorry about that.
I was going to file a bug about false negatives on thread-locals, but that 
turns out to be a known problem.

Original comment by ramosian.glider@gmail.com on 17 Jun 2015 at 6:57

GoogleCodeExporter commented 9 years ago
Adding Project:AddressSanitizer as part of GitHub migration.

Original comment by ramosian.glider@gmail.com on 30 Jul 2015 at 9:14