Say you have a function foo () compiled into a program running on Unix.
While the program is running, can you replace the foo function by dynamically loading the object file containing the modified version of foo ()?
On the embedded system that I worked on in the past, we could unprotect the text segment and then essentially “fix” the address foo () to point to the recently changed foo ().
It was used for debugging on occasion and with many special restrictions on client sites.
Is this possible on Unix?
source
share