How do you make a shared library on RISC System/6000

Bjorn Engsig bengsig at oracle.nl
Fri Jul 27 00:25:25 AEST 1990


As known, the libraries /lib/libc.a etc. are shared.  How do you create one
yourself?  If I e.g. have two sources a1.c and a2.c that I want to compile
and put into libshr.a, so that they will be shared between more programs
linked with libshr.a.

I've tried various methods like the ones shown in the ld manual page (in info),
but I keep getting errors when trying to execute the program:

Could not load program <program-name>
Could not load library libshr.a[a1.o]
Error was: Exec format error

I need to know:

 - which ld options (and export files) are needed to make shared object?

 - are there any special ar options needed to put these into an archive?

 - which ld (cc) options are needed to link my program with this shared archive?

 - Do I need to set the LIBPATH environment?

Thanks for any help - in particular a working example.
-- 
Bjorn Engsig,	Domain:		bengsig at oracle.nl, bengsig at oracle.com
		Path:		uunet!mcsun!orcenl!bengsig



More information about the Comp.unix.aix mailing list