When loading an a.out kernel and keeping the exec header, if it's OMAGIC

put the exec header below kernel text.
This commit is contained in:
simonb 1999-03-25 03:38:53 +00:00
parent 2a91ea8a57
commit 6c24c1c864
1 changed files with 11 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: loadfile.c,v 1.1 1999/03/24 23:51:26 simonb Exp $ */
/* $NetBSD: loadfile.c,v 1.2 1999/03/25 03:38:53 simonb Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -467,11 +467,16 @@ aout_exec(fd, x, marks, flags)
* The kernel may use this to verify that the
* symbols were loaded by this boot program.
*/
if (flags & LOAD_HDR)
BCOPY(x, maxp, sizeof(*x));
if (flags & (LOAD_HDR|COUNT_HDR))
maxp += sizeof(*x);
if (magic == OMAGIC) {
if (flags & LOAD_HDR)
BCOPY(x, maxp - sizeof(*x), sizeof(*x));
}
else {
if (flags & LOAD_HDR)
BCOPY(x, maxp, sizeof(*x));
if (flags & (LOAD_HDR|COUNT_HDR))
maxp += sizeof(*x);
}
/*
* Read in the text segment.