restoring archive from execuable
J. Grant
jg-lists@jguk.org
Fri Oct 24 19:03:00 GMT 2003
Hello,
> Could you please point me to a document explaining how all these things
> work? In my ignorance I thought that a library is simply a collection of
> function code that is copied into the executable at linking time and
> moving them back in a library means only to know where exactly they have
> been copied. Now, I realise that they can not be copied just like that,
> the memory addresses that are used inside the objects have somehow to be
> changed to fit with the memory addresses used in the executable.
An archive is mealy a collection of object files. When linked to
program code with ld, the resulting elf contains a combination of all
sections and object code etc. (See ar and ld documentation)
I do not know of a easy way to recover a collection of object files
which you could then link to from another program. You could try
disassembling and writing new code if the library is not very complex or
find an equivalent library to use.
JG
More information about the Binutils
mailing list