* aout-target.h, netbsd386.c: Replace NO_SWAP_MAGIC with SWAP_MAGIC,

and do the swapping here rather than calling ntohl from the N_*
	macros.  This cleans up assumptions about the size of a host long,
	the existence to ntohl, etc.
This commit is contained in:
Jim Kingdon 1994-01-03 16:16:01 +00:00
parent ae5c71d6c1
commit 3f99570ec9
3 changed files with 17 additions and 8 deletions

View File

@ -1,3 +1,10 @@
Mon Jan 3 11:09:28 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
* aout-target.h, netbsd386.c: Replace NO_SWAP_MAGIC with SWAP_MAGIC,
and do the swapping here rather than calling ntohl from the N_*
macros. This cleans up assumptions about the size of a host long,
the existence to ntohl, etc.
Sat Jan 1 13:50:05 1994 Rob Savoye (rob@darkstar.cygnus.com)
* config.bfd: Add support for VSTa micro-kernel. It currently uses

View File

@ -93,11 +93,11 @@ DEFUN(MY(object_p),(abfd),
return 0;
}
#ifdef NO_SWAP_MAGIC
memcpy (&exec.a_info, exec_bytes.e_info, sizeof(exec.a_info));
#ifdef SWAP_MAGIC
exec.a_info = SWAP_MAGIC (exec_bytes.e_info);
#else
exec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info);
#endif /* NO_SWAP_MAGIC */
#endif /* SWAP_MAGIC */
if (N_BADMAG (exec)) return 0;
#ifdef MACHTYPE_OK

View File

@ -38,11 +38,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#define TARGETNAME "a.out-netbsd-386"
#define N_MAGIC(ex) \
( (((ex).a_info)&0xffff0000) ? (ntohl(((ex).a_info))&0xffff) : ((ex).a_info))
( (((ex).a_info)&0xffff0000) ? ((((ex).a_info))&0xffff) : ((ex).a_info))
#define N_MACHTYPE(ex) \
( (((ex).a_info)&0xffff0000) ? ((ntohl(((ex).a_info))>>16)&0x03ff) : 0 )
( (((ex).a_info)&0xffff0000) ? (((((ex).a_info))>>16)&0x03ff) : 0 )
# define N_FLAGS(ex) \
( (((ex).a_info)&0xffff0000) ? ((ntohl(((ex).a_info))>>26)&0x3f) : 0 )
( (((ex).a_info)&0xffff0000) ? ((((ex).a_info)>>26)&0x3f) : 0 )
#define N_SET_INFO(ex, mag,mid,flag) \
( (ex).a_info = htonl( (((flag)&0x3f)<<26) | (((mid)&0x03ff)<<16) | \
(((mag)&0xffff)) ) )
@ -60,7 +60,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "libaout.h"
#define N_GETMAGIC2(ex) \
( (((ex).a_info)&0xffff0000) ? (ntohl(((ex).a_info))&0xffff) : \
( (((ex).a_info)&0xffff0000) ? ((((ex).a_info))&0xffff) : \
(((ex).a_info) | 0x10000) )
#define N_TXTADDR(ex) (N_GETMAGIC2(ex) == (ZMAGIC|0x10000) ? 0 : 4096)
@ -78,7 +78,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
/* #define N_BADMAG(x) n_badmag(N_MAGIC(x)) */
#define NO_SWAP_MAGIC /* magic number already in correct endian format */
/* On NetBSD, the magic number is always in ntohl's "network" (big-endian)
format. */
#define SWAP_MAGIC(ext) bfd_getb32 (ext)
#include "aout-target.h"