Marcin Kasprzak <mkasprzak@xxxxxxxxxxx> writes: > My platform is x86 machine, running linux with ELF executable. > I'm thinking about the way of doing a sort of conversion from > .so (PIC) to .a (static) lib and then (this part is more tricky) to > relink it against binary. > As I wrote previously I don't have access to source code or .o (object) > files (this is a sort of 3rd party software). > > I believe that two separate actions are needed: > 1. Conversion from .so to .a > 2. decomposition of binary file back to .o files and > one again linkage(ld) process this time against static libs > > Is it possible to do that? No. It is not possible to run a .so file into a .a file. The .so file no longer has any record of the various places which call into the PLT and GOT. It might be possible to do an approximation by somehow introducing an initialization routine which set up the PLT and GOT as required. I don't know of any tool which does that. It is not possible to turn a linked executable back into .o files. The relocation information has been irretrievably lost. Ian