Extract static object from dynamic one
Brian Dessent
brian@dessent.net
Tue Dec 4 14:19:00 GMT 2007
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
More information about the Gcc-help
mailing list