This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Extract static object from dynamic one
- From: Thomas Köppe <t dot koeppe at ed dot ac dot uk>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 03 Dec 2007 23:21:41 +0000
- Subject: Extract static object from dynamic one
Hello,
I've been wondering about a relatively simple question for which there
seems to be no obvious answer - am I overlooking something?
Suppose I have a dynamic C library libfoo.so (or foo.dll) along with
headers in foo.h. Is it possible to build from the binary a static
library libfoo.a?
I'm thinking that this should be easy, since I know all the function
signatures and entry points in the binary; is there some way (maybe with
objcopy or objdump?) in which I can extract the binary code for a
specific function?
Thank you very much,
Thomas K.