I want to patch an ELF executable to insert a function call (the function `s2e_rawmon_loadmodule` and its dependencies are to be linked statically, preferably) at the beginning. [This answer][1] seems to have a nice set of pointers. If I have understood correctly, dynamic instrumentation using PIN/Valgrind/DynamoRIO alters the address space. The addresses of the subsequent instructions get changed which I don't want. For static instrumentation, [ERESI project](http://www.eresi-project.org/) could have been useful. But, it looks like the project has been abandoned for long. I am not being able to build the tool on Ubuntu 14.04 due to compilation issues. Can anybody help me out with some workaround? [1]: http://reverseengineering.stackexchange.com/a/192