I guess, though I'm not quite sure, that,like the text segment of an ELF file in tmpfs
, where the instructions can be executed in place, the data segment in the file doesn't need to be copied until the program is trying to modify the value of a global variable (or a static local variable). That is called COPY ON WRITE
.
To my project, however, it doesn't matter that the ELF files in tmpfs are modified. So I wonder if it would possible to write directly to the data segment of an ELF file while writing a global variable in it. I think this would save a lot of RAM space.