MOCKA 9501 now supports the ELF binary format. Currently (March 1995) most
users will use the a.out binary format, but Linux will only support the
ELF binary format, soon.

The MOCKA installation Makefile will detect with a simple check, if you
have installed the ELF utilities on your system. This checks only if the
/usr/lib/crt1.o file is present. If yes, MOCKA will be installed with
ELF support. If not, MOCKA uses the old a.out format.

!! If you get error messages like
!!  file.o(.text+0x2c): undefined reference to `main'
!! while linking, then you tried to link a.out and ELF files together.

Check the format of the object files:
> file *?*?*?*?*?*.o

Now it is important, that you tell MOCKA the correct paths and options.
Then you can recompile the files, that are in the wrong object format.
It is important that you know which format your /usr/bin/as and your gcc
will produce.

The MOCKA will compile a part of the MOCKA library, which are not
written in Modula-2, with gcc and as. Then MOCKA compiles the MOCKA
library using assembler and linker depending on the automatically
detected format. The MOCKA compiler uses the scripts
mocka/bin/asm and mocka/bin/link for assembling and linking, which you
can specify with the -asm and -link option (e.g. in the mc script).

The MOCKA -elf option must used to create ELF specific assembler files.
The -elf option is passed to the asm and link script. Maybe you can
use the mocka/sys/asm2 and mocka/sys/link2 scripts. But check the paths
if they are correct.

MOCKA uses following:

default installation (a.out binary format) in mocka/Makefile:
ASMSCRIPT = asm
LINKSCRIPT = link
uses
/usr/bin/as
/usr/bin/ld
/usr/lib/crt0.o
/usr/lib/libc.*
/lib/libc.*
with a.out support

default installation (ELF binary format) in mocka/Makefile:
ASMSCRIPT = asm2
LINKSCRIPT = link2
LIBOPTS += -elf
MCOPTS += -elf
MCBOOTOPTS += -elf
uses
/usr/bin/as
/usr/bin/ld
/usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o
/usr/lib/crtend.o /usr/lib/crtn.o
/usr/lib/libc.*
/lib/libc.*

With the second installation you can use both a.out and ELF format, if
the a.out support files are located in
/usr/i486-linuxaout/{bin,lib}/
and the ELF support in
/usr/{bin,lib}/

But the MOCKA Makefile will only produce one lib library in one binary
format. If you really want both binary formats you need two mocka/lib
libraries (a.out and ELF). You should create the second library by hand
and should modify the mc script, to include the correct MOCKA library
with the -syslib option. But attention! If you try to link a.out and
ELF object files together, you will get errors from the linker. MOCKA
doesn't check the object format before calling the linker.
