I wrote a simple test file and compiled it using icc compiler. In the program I tried to overwrite the data which is in the section rodata. Compiler thrown a warning but it's allowing me to overwrite it. Here is the way I did....
const char arr="abcdefgh";
printf("after writing to arr:%s\n",arr);
#test_crash.c(22): warning #2330: argument of type "const char *" is incompatible with parameter of type "void *" (dropping qualifiers)
after writing to arr:zzzzzzZ
But My intention is to provide some protection for the rodata section....
How can I achieve this???
Any compiler options available to do this??