/* 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 anyone know why or how to ask the compiler (or linker) to output a warning message when "placing constant data into non-read-only section"? thanks.
PS. I resolve my problem by adding __attribute__((section(".rodata")))
__attribute__((section(".rodata"))) volatile const int TEST_ro[512] = {test_256X, test_256X};
PS. I use linaro-gcc compiler for ARM core