GCC: why constant variables not placed in .rodata

The compiler has made it a common, which can be merged with other compatible symbols, and which can go in bss (taking no space on disk) if it ends up with no explicitly initialized definition. Putting it in rodata would be a trade-off; you’d save memory (commit charge) at runtime, but would use more space on disk (potentially a lot for a huge array).

If you’d rather it go in rodata, use the -fno-common option to GCC.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)