Attached test.c is code extracted from elflink.c to demonstrate the problem.
You can use attached comp.sh to compile the test program. The test program
must be compile inside the bfd directory of the binutils-2.15 package. The
embedded data is the data extract from the gcc-3.4 build which caused
ld-2.15 to crash. BTW, the test program also shows a possible work around of
the problem, i.e. instead of doing the calculation, simply comparing the
values inside elf_sort_symbol. (You may also use the attached diff file to
patch elflink.c.) The patch seems working fine or at least survived the gcc
build cycle.