/* 0xFFFFFFFF * 256*/#define test_256X0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, ... 0xFFFFFFFF
After compiling, the const array is placed in ".rwdata" section rather than ".rodata" section, and I don't know why.
After google and searching the stackoverflow site, there is no specified answer. Does any one know why or how to ask compiler(or linker) to output warning message when "placing constant data into non-read-only section"? thanks.
PS. I resolve my problem by add attribure((section(".rodata")))
__attribure__((section(".rodata"))) volatile const int TEST_ro[512] = {test_256X, test_256X};
PS. I use linaor-gcc compiler for arm core