I have a game code (from ioquake3 project) that compiles part of gameplay binaries on the fly (the qvm system). Now, one could potentially speed it up by loading previously saved binaries of this operation (with any change-of-files precautions in place).
But, pointers to functions saved in these binaries are not persistent through sessions.
What would be the proper way to change those on the fly? (considering one has the assembler and assembly for it available in the main application)
That’s pretty much what a normal loader for executables does. They usually work by storing a table of the places there are references to addresses that will need to be changed based on where the file is loaded. Typically, they store a relative address in each of those locations, so to load the file, you look at the table and add the base load address to what’s at each of those addresses, and put that result into image as its loaded into memory.