[0/21] Add support for AIX 6

David Edelsohn dje.gcc@gmail.com
Tue Mar 10 18:18:00 GMT 2009

>>>>> 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

The F_LOADONLY flag in the object header means that the shared
object will be ignored by the ld command when linking the archive,
but available to the runtime loader.  Previously linked applications
will refer to the old shared object members in the archive and newly
linked applications will refer to the most recent shared object.

The AIX linker does not require that the file extension match the contents,
so a shared object could be named libNAME.a -- not an archive containing
the file, but the file itself.  As you imply, libNAME.so could be an archive.
Ignoring naming conventions does generate some confusion.

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.


More information about the Binutils mailing list