gcc: __DATA,__const vs __TEXT,__const
gcc
Solution
The __TEXT, __const section is for non-relocatable initialized constant data. An example would be a jumtable. Relocatable read-only data, like the examples you gave, go to __DATA, __const.
Problem
According to the Mac OS X ABI Mach-O File Format Reference, `__DATA,__const` holds Initialized relocatable constant variables. I poked around a bit and it looks like gcc places initialized const structures and arrays in `__DATA, __const`. Why not `__TEXT,__const`, though? Koi8rModel and CI_nsJSCID, for example, are initialized const structures, whereas AlignStrings is an array. ``` nm -m MinefieldNoPic.app/Contents/MacOS/firefox-bin |grep Koi8rModel 000000010156ce80 (__DATA,__const) non-external _Koi8rModel nm -m MinefieldNoPic.app/Contents/MacOS/firefox-bin |grep CI_nsJSCID 0000000101441060 (__DATA,__const) non-external __ZL10CI_nsJSCID nm -m MinefieldNoPic.app/Contents/MacOS/firefox-bin |grep AlignStrings 000000010154f8c0 (__DATA,__const) non-external __ZL13sAlignStrings ```