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: [email protected]
ReportedBy: [email protected]
CC: [email protected], [email protected],
[email protected], [email protected]
[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]$