From f4dc9a4015c8d1239b3a4e06a16aba940fddd9a2 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 28 Jun 2012 07:33:43 +0000 Subject: [PATCH] Remove an old hack I noticed years ago, but never committed. --- sys/kern/imgact_aout.c | 10 +++++----- sys/kern/imgact_gzip.c | 4 ++-- sys/sys/imgact_aout.h | 1 - 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index 3908da7bd24..3ade6a22d34 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -174,9 +174,9 @@ exec_aout_imgact(struct image_params *imgp) * 0x64 for Linux, 0x86 for *BSD, 0x00 for BSDI. * NetBSD is in network byte order.. ugh. */ - if (((a_out->a_magic >> 16) & 0xff) != 0x86 && - ((a_out->a_magic >> 16) & 0xff) != 0 && - ((((int)ntohl(a_out->a_magic)) >> 16) & 0xff) != 0x86) + if (((a_out->a_midmag >> 16) & 0xff) != 0x86 && + ((a_out->a_midmag >> 16) & 0xff) != 0 && + ((((int)ntohl(a_out->a_midmag)) >> 16) & 0xff) != 0x86) return -1; /* @@ -184,7 +184,7 @@ exec_aout_imgact(struct image_params *imgp) * We do two cases: host byte order and network byte order * (for NetBSD compatibility) */ - switch ((int)(a_out->a_magic & 0xffff)) { + switch ((int)(a_out->a_midmag & 0xffff)) { case ZMAGIC: virtual_offset = 0; if (a_out->a_text) { @@ -203,7 +203,7 @@ exec_aout_imgact(struct image_params *imgp) break; default: /* NetBSD compatibility */ - switch ((int)(ntohl(a_out->a_magic) & 0xffff)) { + switch ((int)(ntohl(a_out->a_midmag) & 0xffff)) { case ZMAGIC: case QMAGIC: virtual_offset = PAGE_SIZE; diff --git a/sys/kern/imgact_gzip.c b/sys/kern/imgact_gzip.c index f61334a6292..1333abefb0f 100644 --- a/sys/kern/imgact_gzip.c +++ b/sys/kern/imgact_gzip.c @@ -161,7 +161,7 @@ do_aout_hdr(struct imgact_gzip * gz) * Set file/virtual offset based on a.out variant. We do two cases: * host byte order and network byte order (for NetBSD compatibility) */ - switch ((int) (gz->a_out.a_magic & 0xffff)) { + switch ((int) (gz->a_out.a_midmag & 0xffff)) { case ZMAGIC: gz->virtual_offset = 0; if (gz->a_out.a_text) { @@ -177,7 +177,7 @@ do_aout_hdr(struct imgact_gzip * gz) break; default: /* NetBSD compatibility */ - switch ((int) (ntohl(gz->a_out.a_magic) & 0xffff)) { + switch ((int) (ntohl(gz->a_out.a_midmag) & 0xffff)) { case ZMAGIC: case QMAGIC: gz->virtual_offset = PAGE_SIZE; diff --git a/sys/sys/imgact_aout.h b/sys/sys/imgact_aout.h index ca67cab6584..48086bd6966 100644 --- a/sys/sys/imgact_aout.h +++ b/sys/sys/imgact_aout.h @@ -119,7 +119,6 @@ struct exec { uint32_t a_trsize; /* text relocation size */ uint32_t a_drsize; /* data relocation size */ }; -#define a_magic a_midmag /* XXX Hack to work with imgact_{aout,gzip}.c */ /* a_magic */ #define OMAGIC 0407 /* old impure format */