Every program needs to have a Code Section segment. Is this code segment read only? If so, how are dynamic changes implemented, such as the use of a dynamic library? Also, how is the interpreter making changes to the read only code section? If it's not read only, which it should be, how is it present in the L1-I cache, which itself is read only?
Asked
Active
Viewed 42 times
0
-
You're confusing compiled and interpreted. Every compiled program needs to have a code segment. Interpreted code does not - that's handled in the interpreter. There are no changes being made to the read only code section in interpreted code, because there is no read only code section. – Ken White Dec 01 '19 at 05:27
-
@KenWhite So you mean at the hardware level, instruction cache actually has the interpreter code, which fetches the actual user code from the main memory? – Overlord720 Dec 01 '19 at 05:45
-
No, I mean that the interpreter itself handles the actual user code, and the hardware has no interaction with that user code - the interpreter is the one that interacts with the hardware. Interpreted code only interacts with the interpreter. Interpreted code means that all interactions with anything are done by the interpreter. – Ken White Dec 01 '19 at 05:47
-
@KenWhite Okay, thanks. I'll accept that an answer. – Overlord720 Dec 01 '19 at 10:23