Subject: Gas-2.5 for NetBSD.i386 has wrong magic number ...
To: <>
From: Andrew Cagney <cagney@highland.com.au>
List: tech-ports
Date: 10/19/1994 16:44:45
Hello,


OS: NetBSD BETA NetBSD 1.0_BETA, Mon Aug  1 16:48:16 PDT 1994
Arch: i386
Package: gas-2.5


When gas-2.5 is built for NetBSD.i386 (target==host) it is configured
to *not* use bfd.  Instead the `builtin' aout code is used.  As a
result:

	o	The a_info (magic nr et.al.) are written to the
		file in host (little) endian mode.

		NetBSD a_info field is in network endian order


	o	The Magic number doesn't include the `machine'
		information (0x86 for NetBSD.i386).


The quick fix is to change gas-2.5 for i386-*-netbsd* to be built
using bfd_gas=yes. (Assuming that bfd has been fixed to correctly
create NetBSD object files :-)

					Andrew


PS: On the bright site, NetBSD.i386 object files are correct.

PPS: This diff is for reference only...

***************
*** 84,90 ****
                         emulation=i386aix ;;
    i386-*-bsd*)                obj_format=aout emulation=386bsd ;;
    i386-*-netbsd0.8)   obj_format=aout emulation=386bsd ;;
!   i386-*-netbsd*)     obj_format=aout emulation=netbsd ;;
    i386-*-linux*elf*)  obj_format=elf  emulation=linux ;;
    i386-*-linux*coff*) obj_format=coff emulation=linux
                         gas_target=i386coff ;;
--- 88,94 ----
                         emulation=i386aix ;;
    i386-*-bsd*)                obj_format=aout emulation=386bsd ;;
    i386-*-netbsd0.8)   obj_format=aout emulation=386bsd ;;
!   i386-*-netbsd*)     obj_format=aout emulation=netbsd bfd_gas=yes ;;
    i386-*-linux*elf*)  obj_format=elf  emulation=linux ;;
    i386-*-linux*coff*) obj_format=coff emulation=linux
                         gas_target=i386coff ;;