[clean-list] "Linker exited abnormally"

John van Groningen johnvg at cs.ru.nl
Wed Jul 7 17:10:47 MEST 2010


David Norris wrote:
>I'm using clm on Linux; the compile succeeds, but linking fails:
>
>--snip--
>Linking the_program
>Linker exited abnormally
>--snip--
>
>Would anyone be able to offer a tip on how to make this message more
>informative, or how otherwise to explore failure of link?  (The -mv
>option to clm yields no additional info about the link failure.)

This probably means that the optimizing linker (exe/linker) crashes.
Most likely because an incorrect or unsupported object file has been
generated.

You can disable this optimizing linker, by passing -no-opt-link
to clm. The optimizing linker is not used in that case, but only
the system linker. However because the system linker doesn't remove
unused code, a large executable will be generated. If the Clean
compiler has generated an incorrect object file, the system linker
might be able to tell you that.

If you are linking object files generatad by the c compiler,
try linking without them, to see if the c compiler has generated
an object file that is not compatible with the Clean linker.
You can bypass the optimizing linker by adding a ':' before
the name of the object file.

You can also try to find the problem by invoking the linker
(exe/linker) with the object files. The first argument is the name
of the generated object file, the remaining arguments are the
file names of the object files and libraries that should be linked.

Or you can try to the debug the linker. It can be compiled with:

cd tools/elf_linker
clm -I ia32 -I ../../libraries/ArgEnvUnix -I ../../compiler/main/Unix \
	-l ../../libraries/ArgEnvUnix/ArgEnvC.o \
	-l ../../compiler/main/Unix/set_return_code_c.o \
	-s 2m -h 20m -nt -nr linker -o linker

(ArgEnvC.o and set_return_code_c.o should be generated first
by the c compiler.)

It might be an array index error, so recompiling with -ci might help.
If an index error occurs, try recompiling with -tst to find the
function where this happens.

And of course, if you can send us the source code of a program that
causes the linker to crash, we will try to locate and fix this bug.

Kind regards,

John van Groningen


More information about the clean-list mailing list