diff options
Diffstat (limited to 'src/libmach/executable.c')
-rw-r--r-- | src/libmach/executable.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libmach/executable.c b/src/libmach/executable.c index 6bde5b5a4..1455b100d 100644 --- a/src/libmach/executable.c +++ b/src/libmach/executable.c @@ -514,7 +514,12 @@ commonllp64(int unused, Fhdr *fp, ExecHdr *hp) */ if((hp->e.exechdr.magic & ~DYN_MAGIC)>>16) return 0; - entry = beswav(*(uvlong*)&hp->e.exechdr); + union { + char *p; + uvlong *v; + } u; + u.p = (char*)&hp->e.exechdr; + entry = beswav(*u.v); pgsize = mach->pgsize; settext(fp, entry, pgsize+fp->hdrsz, hp->e.exechdr.text, fp->hdrsz); |