Question: I've noticed (on Win32 at least) that in executables, code sections (.text) have the "read" access bit set, as well as the "execute" access bit. Are there any bonafide legit reasons for code to be **reading** itself instead of **executing** itself? I thought this was what other sections were for (such as .rdata).

(Specifically, I'm talking about [`IMAGE_SCN_MEM_READ`](http://elfz.laacz.lv/ms_exe_spec.html#L41).)

Answer: 
Compile-time constants, particularly for long long or double values, are often loaded with a mov register, *address* statement from the code segment.
The one example I can think of for a reason to read code is to allow for self modifying code. Code must necessarily be able to read itself in order to be self modifying. 

Also consider the opposite side. What advantage is gained from disallowing code from reading itself? I struggled for a bit on this one but I can see no advantage gained from doing so.