This is the third test release of the ELF package for Linux/68k.

This directory contains the basic binaries needed to set up an ELF
configuration:

- gcc 2.7.0 generating ELF output
- gcc 2.7.0 generating a.out output
- binutils 2.5.2 (snapshot 950901) for both ELF and a.out
- libc 5.0.9
- ld.so 1.7.3, the dynamic linkers for ELF and a.out

All programs are in ELF format, except for the dynamic linker for
a.out and the statically linked programs ldd and ldconfig.

As of version 0.9.10 no kernel patches are required to be able to run
ELF.

Please read the instructions *very* carefully, otherwise you might end
up with a system in an unusable state.  You should prepare a ramdisk
image or boot floppy to be able to boot from in emergency cases.
Don't forget to backup the a.out version of the compiler and binutils,
in case you have to revert back.


HOW TO INSTALL LINUX/ELF

Before you start, make sure that you have a working ramdisk or boot
floppy that you can boot from, in case something bad happens (hopfully
not!).  I cannot guarantee that the following instructions are
complete, since my step to ELF was a much longer process (and much
more difficult :-/ ).

Note that the FSSTND has moved the files utmp and wtmp again.  They
now reside in /var/run/utmp and /var/log/wtmp, resp.  The ELF library
libc 5.0.9 (as well as libc 4.7.2) will assume the new places.  To
convert do the following steps: a) move /var/adm/utmp to
/var/run/utmp, b) rename /var/adm to /var/log, c) create a symbolic
link /var/adm -> /var/log, d) update the links for utmp and wtmp in
/etc, e) eventually change the rc scripts to reflect the new setup.

As the very first step you have to prepare a kernel that can actually
execute ELF binaries.

0. Configure the Linux kernel to include support for the ELF binary
   format.  Since kernel version 0.9.10 all necessary support for ELF
   is already included.

The following steps should be done as root.

1. Create the directories /usr/m68k-linuxaout/bin and
   /usr/m68k-linuxaout/lib.

2. Edit /etc/ld.so.conf and add /usr/m68k-linuxaout/lib.

3. Move all the a.out *.o, *.a, *.so.* and *.sa files from /usr/lib
   and other places (like /usr/local/lib) to /usr/m68k-linuxaout/lib.
   The linker for a.out will only look there for libraries.  The
   *.so.* files in /lib should stay there.  Run /sbin/ldconfig to
   update the cache.

4. Move the directory /usr/include to /usr/m68k-linuxaout/include.

5. Unpack libc-5.0.9.tar.gz while in the root directory.  This will
   install the ELF libraries in /lib and /usr/lib.  Update the
   symbolic links for `linux' and `asm' in /usr/include to point to
   the kernel sources.

6. Backup the a.out /usr/bin/ld and /usr/bin/as.  Don't put them in
   /usr/m68k-linuxaout/bin.  Then remove them.

7. Unpack binutils-950901.bin.tar.gz while in the root directory.
   This will install ld, as and the other binutils as ELF binaries,
   together with the shared libraries libbfd and libopcodes, that are
   used by them (this decreases the space requirements quite a bit).
   All of them, except the assembler, will be able to accept and
   generate both the a.out and the ELF format.  The default assembler
   in /usr/bin/as will only generate the ELF format.  The assembler
   for a.out is in /usr/m68k-linuxaout/bin/as.

8. Unpack gcc-2.7.0.bin.tar.gz while in the root directory.  This will
   install the ELF binaries of the compilers for ELF and a.out.  The
   first will reside in /usr/lib/gcc-lib/m68k-linux, the latter in
   /usr/lib/gcc-lib/m68k-linuxaout.

9. Unpack ld.so-1.7.3.tar.gz somewhere (not in the root directory),
   change into the extracted directory and run `sh instldso.sh'.  This
   will carefully install both the ELF and a.out dynamic linker,
   together with new versions of /sbin/ldconfig and /usr/bin/ldd.

Now you have (hopefully) finished the installation process.  The
compiler will now by default generate ELF binaries, to compile into
a.out format (for example to compile the kernel) use `gcc -b
m68k-linuxaout'.  Note that there is only one linker for both ELF and
a.out.  By default, /usr/bin/ld will produce ELF output, use `ld -m
m68klinux' for a.out.  This will be done automagically if called via
`gcc -b m68k-linuxaout'.  You should modify the compiler, assembler
and linker specs (the variables CC, AS, and LD) in MakeVars in the
kernel source accordingly.  The files in /usr/m68k-linux/bin and
/usr/m68k-linuxaout/bin are merely links to the corresponding files in
/usr/bin, except for the a.out assembler, which is separate.


CHANGES FROM THE PREVIOUS RELEASE

- The assembler syntax generated by the ELF compiler has changed when
  compiling with -fpic.  The assembler from the previous release
  cannot parse this, and neither can the assembler in this release
  parse the pic code generated by gcc 2.6.3.  Thus if you want to
  compile a shared library you should either use gcc 2.7.0 and the new
  assembler or gcc 2.6.3 and the old assembler.  For a.out or non-pic
  ELF compilation it should not matter which assembler you use.


ACKNOWLEDGEMENTS

I'd like to thank Eric Youngdale, Stephan Gro and Jes Degn Soerensen
for helping me to get the description of the ELF format.  Stephan Gro
contributed a copy of the System V ABI/68000 Processor Supplement.
The instructions were derived from a text by H.J. Lu.

Good luck!
Comments and bug reports are welcome.

-- 
Andreas Schwab
schwab@issan.informatik.uni-dortmund.de
