Fix the assembler so that it produces object files with the correct

magic number byte ordering for FreeBSD.  This makes "file" describe
our object files as "FreeBSD/i386 object" instead of as NetBSD
object files.  In case this seems drastic and risky, Bruce points
out that the "ld -r -x" step that is done on every object file when
building libraries fixes the byte ordering in the same way.  I have
been running with this patch for over a month and have seen no
problems.
This commit is contained in:
John Polstra 1998-04-10 01:20:40 +00:00
parent 7c2e3d329a
commit 261e267ac2
2 changed files with 3 additions and 3 deletions

View File

@ -142,7 +142,7 @@ object_headers *headers;
{
tc_headers_hook(headers);
#if defined(FREEBSD_AOUT) || defined(NETBSD_AOUT)
#if defined(NETBSD_AOUT)
/* `a_info' (magic, mid, flags) is in network byte-order */
(*where)[0] = ((char *)&headers->header.a_info)[0];
(*where)[1] = ((char *)&headers->header.a_info)[1];

View File

@ -17,7 +17,7 @@
License along with GAS; see the file COPYING. If not, write
to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
$Id$
$Id: obj-aout.h,v 1.7 1997/02/22 15:44:22 peter Exp $
*/
@ -168,7 +168,7 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */
#define H_SET_INFO(h,mag,mid,f,v) \
( (h)->header.a_info = \
htonl( (((f)&0x3f)<<26) | (((mid)&0x03ff)<<16) | (((mag)&0xffff)) ) )
(((f)&0x3f)<<26) | (((mid)&0x03ff)<<16) | (((mag)&0xffff)) )
#endif /* FREEBSD_AOUT */