If you can understand C++, use the source Luke.
See: Assemblers and Loader, by David Solomon. [some pearls of wisdom, some archaic trivia]
As I understand, the printf
is in the same file and you need to patch the address at run-time. In this case, the relocation is a 24-bit PC relative relocation. The answer is you do nothing in this case. As the executable and the implementation are both in the same binary, the 24-bit PC relative
is already relocated no matter what the load address is.
If you were relocating a shared library, the process would be different.