This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Extract static object from dynamic one
Thomas Köppe wrote:
> Is there an obstruction in principle (that some vital information is
> lost in the shared library), or is it simply that no such tool has been
> written?
It's not just a matter of extracting something. You'd have to rewrite
all accesses through the GOT and PLT (for ELF) or indirections through
.idata (for PE) to be regular symbol references. You'd have to undo
relocs and make them into regular labels. With things like relaxation
this becomes extremely nontrivial. In a sense this is going backwards,
like a disassembler, because a static library is just a collection of
unlinked .o files, whereas a shared library is fully linked.
Brian