Library extension .a/.so

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Apr 26 21:28:51 UTC 2005


On Tue, Apr 26, 2005 at 10:33:53AM -0400, John Vetterli wrote:
> This site gives some info on how to create a shared-object library:
> http://www.linux.com/howtos/Program-Library-HOWTO/more-examples.shtml
> 
> To convert from libsomething.a to libsomething.so, I'm guessing you would 
> have to extract the object files from libsomething.a with the ar program, 
> then follow the instructions on that page to use them to build 
> libsomething.so.

In general you can't do it without a recompile of the sources since most
.a files tend to have position dependant code and function index
tables for linking into place.  .so on the other hand have PIC (position
independant code) to allow it to load anywhere in the application's
memory space depending on where it gets loaded along with the application.

So converting is really not trivial.  The structure of the assembly code
has to change.

Lennart Sorensen
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list