This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: How to convert a Linux ELF executable (with *.h file, no *.c file, no *.o file) to shared library (*.so)?
- From: Ian Lance Taylor <iant at google dot com>
- To: News Provider <dionysiusalexander at yahoo dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 11 Jul 2011 11:52:24 -0700
- Subject: Re: How to convert a Linux ELF executable (with *.h file, no *.c file, no *.o file) to shared library (*.so)?
- References: <1310377231.8971.YahooMailClassic@web113606.mail.gq1.yahoo.com>
News Provider <dionysiusalexander@yahoo.com> writes:
> Summary
> =======
> Given only these two files:
>
> (1) an existing Linux32 executable file in ELF format (but no *.c file, and no *.o file), and
>
> (2) a corresponding C header file (*.h) declaring several 'extern' functions defined in the above ELF file...
>
>
> Question
> --------
> Is it possible to use gcc (or some similar tool) to produce a shared/dynamic library (*.so file) [or alternatively, a static library (*.a file)]...
>
> ...using **only** the original ELF executable and the C header file (*.h) - ie, with no C source file (*.c) and no object file (*.o) available?
No, it is not possible. An executable is not a shared library.
Ian