Problem
I wish to inject an object file into an existing binary. As a concrete example, consider a source Hello.c:
Hello.c
#inc
Have you looked at the DyninstAPI? It appears support was recently added for linking a .o into a static executable.
From the release site:
Binary rewriter support for statically linked binaries on x86 and x86_64 platforms