This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: restoring archive from execuable


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]