[0/21] Add support for AIX 6

Michael Haubenwallner michael.haubenwallner@salomon.at
Wed Mar 11 09:37:00 GMT 2009


On Tue, 2009-03-10 at 14:18 -0400, David Edelsohn wrote:
> >>>>> Michael Haubenwallner writes:
> 
> > Did you also think on providing some 'soname' support for AIX?
> 
> > When runtime linking (-brtl) is active, at link-time the import file is
> > found, recording "libNAME.so.X(shr.o)" into the resulting binary for
> > run-time.
> 
> Interesting approach.
> 
> Because AIX archives can hold multiple shared objects and shared
> objects can be tagged as load-only, the traditional concept on AIX is
> intended to be something like:
> 
> - create new shared object libNAME.so.X.Y.Z
> - unpack existing shared objects from archive
> - set most recent shared object as load-only
>   $ strip -e libNAME.so.X.Y.Z-1
> - archive the old and new shared objects in libNAME.a

Yes, we do that already.
But when a shared object has undefined symbols and thus *requires* -brtl
for the executable to work, I'd rather have this shared object not found
when linking without -brtl, where only .a is searched.
In this case, I'd create a pure static libNAME.a, and have the shared
object found via libNAME.so only.

> Because AIX ld dynamic linking and the -brtl option does support
> ELF-style shared objects, one also can establish the soname
> libraries and symbolic links directly:
> 
> - create libNAME.so.X.Y.Z
> - create the symlinks known from linux/elf:
>      libNAME.so -> libNAME.so.X
>      libNAME.so.X -> libNAME.so.X.Y.Z
> 
> Linking an executable with libNAME.so and using -brtl option
> will associated libNAME.so with the executable, not
> libNAME.so.X.Y.Z. and not any archive members.

I don't want to have libNAME.so recorded for runtime, but libNAME.so.X,
for cases where a different version (soname) of the same library is
installed in parallel and selected for future linktime already, thus
libNAME.so pointing to an incompatible library for the old binary.

But wait - it should also work this (more obvious) way:
* create the archive libNAME.a from static objects only
* create the shared object libNAME.so.X.Y.Z
* create the import file   libNAME.imp.X.Y.Z with "#! libNAME.so.X"
* create the symlink libNAME.so.X -> libNAME.so.X.Y.Z
* create the symlink libNAME.so   -> libNAME.imp.X.Y.Z
* when linking with -brtl, libNAME.so.X gets autoloaded
* when linking without -brtl, pure static libNAME.a is found.
* no need for the F_LOADONLY trick

And when the shared object is uesable without -brtl, although created
with -G linker flag, the traditional way should work:
* create the shared object libNAME.so.X
* create the archive libNAME.a from libNAME.so.X only
* create the import file libNAME.imp.X.Y.Z with "#! libNAME.a(libNAME.so.X)"
* create the symlink libNAME.so -> libNAME.imp.X.Y.Z
* when linking with -brtl, the shared object gets autoloaded via import file
* when linking without -brtl, it is found in the archive
* do the F_LOADONLY trick when installing another version (soname).

But this all seems off-topic for binutils, should be libtool instead?

/haubi/



More information about the Binutils mailing list