This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: relinking a program with shared library
- From: Tim Prince <TimothyPrince at sbcglobal dot net>
- To: Marcin Kasprzak <mkasprzak at autograf dot pl>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 29 Dec 2008 07:22:03 -0800
- Subject: Re: relinking a program with shared library
- References: <Q188408641-4d80a21192ab8dedf43e96a7b6bbc469@pmq1.test.onet.pl>
- Reply-to: tprince at computer dot org
Marcin Kasprzak wrote:
> I wonder to know if it is possible to somehow perform
> a static (re)linking of already compiled binary that uses a shared libs?
> For example I have a binary "bin" which depends on "libA.so" and "libB.so".
> Would it be possible to relink it statically so that both libraries
> would be included within "bin"?
If this were possible on some platform, it would be a function of the
linker system (binutils, for many gcc targets). It's certainly not
something gcc itself could do.
On all systems I am familiar with, if you have the objects made by gcc,
you can accomplish this by re-linking.