Question ~ Using objcopy to convert a .a to .o

Ross A. Osborn rosborn at
Fri Jun 6 15:56:47 UTC 2008

On Thu, Jun 05, 2008 at 01:43:18PM -0700, Amalaye Oyake wrote:
> Hello,
> I want to use objcopy to copy some objects from a static library (.a) into a
> standalone object (.o). 
> I have a very good reason why I want to do this ... how do I do it though? I
> have only marginally tinkered with objcpy ... 
> Any pointers would be appreciated.

Do you mean you have a good reason for extracting object files from an
archive or a good reason for using objcopy to do the job?

It seems to me that objcopy is the wrong tool for this job.  To extract
object files from an archive I would use ar.  If I wanted multiple
object files combined into a single object file then I would use ld.


More information about the users mailing list