Subject: Linking a.out ld.so on elf machines
To: None <tech-toolchain@netbsd.org>
From: Krister Walfridsson <cato@df.lth.se>
List: tech-toolchain
Date: 05/21/2000 20:19:40
I haven't really followed the discussions about a.out to elf transission,
but as I understand, the idea is to compile an a.out ld.so on elf machines
too, to make it possible to use old binaries. Anyway, I have promised to
teach ld.new to make a.out shared libs.

I have a (nearly) working version now, but I don't really understand how
this will help us... But my knowledge is in the inner working of libbfd,
not in the binutils, so I may have misunderstood something.

Bill Studenmund tried some with this in december, and did:

   ld -o ld_aout.so.mrg -Ttext 0x1020   -L/usr/src/lib/libc/obj.i386
   mdprologue.o rtld.o malloc.o shlib.o md.o vfprintf.o -lc_pic
   crunchide -v -u ld_aout.so.mrg
   objcopy -R .note -R .ident ld_aout.so.mrg ld_aout.so.mrg1
   ld -o ld_aout.so --oformat a.out-i386-netbsd  -T \
   /usr/src/libexec/ld.aout_so/elf_aout_merge.x -Bshareable \
   -Bsymbolic -assert nosymbolic  ld_aout.so.mrg1

But the first link creates an executable. Is it obvious that it
can be converted to an a.out shared lib? It doesn't work for me
anyway...

I tried to convert the .o files to a.out and then link normally,
but I cannot use objcopy to convert the files. It complains that
it cannot represent .rodata in a.out object file format...

So, does anyone have any suggestions on how this should be solved?

   /Krister