Is there a way to find out what gcc flags a particular binary was compiled with?
Experimental proof:
diciu$ gcc -O2 /tmp/tt.c -o /tmp/a.out.o2 diciu$ gcc -O3 /tmp/tt.c -o /tmp/a.out.o3 diciu$ diff /tmp/a.out.o3 /tmp/a.out.o2 diciu$
I take that as a no as the binaries are identical.