http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55739
Bug #: 55739 Summary: asan doesn't work on common symbols Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: sanitizer AssignedTo: unassig...@gcc.gnu.org ReportedBy: hjl.to...@gmail.com CC: do...@gcc.gnu.org, dvyu...@gcc.gnu.org, ja...@gcc.gnu.org, k...@gcc.gnu.org [hjl@gnu-6 bound-1]$ cat c.c #include <stdio.h> int c[30]; void foo (int a[]) { printf ("10: %d\n", a[10]); } [hjl@gnu-6 bound-1]$ cat m.c #include <stdio.h> extern int c[]; void foo (int []); int main () { c[30] = 1; foo (c); printf ("30: %d\n", c[30]); return 0; } [hjl@gnu-6 bound-1]$ make /export/build/gnu/gcc/build-x86_64-linux/gcc/../../release/usr/gcc-4.8.0/bin/gcc -fsanitize=address -O -static-libasan -c -o m.o m.c /export/build/gnu/gcc/build-x86_64-linux/gcc/../../release/usr/gcc-4.8.0/bin/gcc -fsanitize=address -O -static-libasan -c -o c.o c.c /export/build/gnu/gcc/build-x86_64-linux/gcc/../../release/usr/gcc-4.8.0/bin/gcc -fsanitize=address -O -static-libasan -o x m.o c.o ./x 10: 0 30: 1 [hjl@gnu-6 bound-1]$