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
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.
I just realized that my question contained the answer. __DATA,__const is for relocatable bits indeed but the reason the bits in my question are relocatable is because they are pointers and thus need to be fixed up at runtime.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With