Next Previous Contents

6. Backward Compatibility With a.out Binaries

In a very few cases, it is necessary to use a.out binaries, either because the source code is not available or because it is not possible to build new ELF binaries from the source for some reason.

As it happens, ELF installations almost always have a complete set of a.out libraries in the /usr/i486-linuxaout/lib directory. Theoretically, a.out binaries should be able to find these libraries at runtime, but this may not always be the case.

Note that the kernel should have a.out support built into it, either directly or as a loadable module. It may be necessary to rebuild the kernel to enable this. Moreover, some Linux distributions require installation of a special compatibility package, such as Debian's xcompat for executing a.out X applications.

6.1 An Example

Jerry Smith wrote a very handy rolodex program some years back. It uses the Motif libraries, but fortunately is available as a statically linked binary in a.out format. Unfortunately, the source refuses to rebuild using the lesstif libraries. Even more unfortunately, the a.out binary bombs on an ELF system with the following error message.

xrolodex: can't load library '//lib/libX11.so.3'
        No such library

As it happens, there is such a library, in /usr/i486-linuxaout/lib, but xrolodex is unable to locate it at run time. The simple solution is to provide a symbolic link in the /lib directory:

ln -s /usr/i486-linuxaout/lib/X11.so.3.1.0 libX11.so.3

It turns out to be necessary to provide similar links for the libXt.so.3 and libc.so.4 libraries. This needs to be done as root, of course. Note that you should make absolutely certain you will not overwrite or cause version number conflicts with pre-existing libraries. Fortunately, the new ELF libraries have higher version numbers than the older a.out ones, to anticipate and forestall just such problems.

After creating the three links, xrolodex runs fine.

The xrolodex program may be obtained from Spectro.


Next Previous Contents