summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1997-01-18 03:28:51 +0000
committerJason Downs <downsj@cvs.openbsd.org>1997-01-18 03:28:51 +0000
commitd4060fcbff1251f74772b9f3199ccc493c52795b (patch)
tree6a57756c13f2911508303581f37b5fbe6cfa8526
parent8006bf5974e2efb6b799c73c01b3b6a7478d22b8 (diff)
Gross hack for hp300, and a fix for NO_LSEEK as pointed out by briggs.
-rw-r--r--sys/lib/libsa/exec.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/lib/libsa/exec.c b/sys/lib/libsa/exec.c
index 85d74296677..be9a66f9b7f 100644
--- a/sys/lib/libsa/exec.c
+++ b/sys/lib/libsa/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.7 1996/12/08 15:15:49 niklas Exp $ */
+/* $OpenBSD: exec.c,v 1.8 1997/01/18 03:28:50 downsj Exp $ */
/* $NetBSD: exec.c,v 1.15 1996/10/13 02:29:01 christos Exp $ */
/*-
@@ -48,6 +48,12 @@ static char *ssym, *esym;
extern u_int opendev;
+#ifdef hp300
+#undef N_PAGSIZ
+/* XXX - force padding of the text segment to 4k, not 8k. */
+#define N_PAGSIZ(_x) 0x1000
+#endif
+
void
exec(path, loadaddr, howto)
char *path;
@@ -87,7 +93,8 @@ exec(path, loadaddr, howto)
printf("%ld", x.a_text);
addr = loadaddr;
#ifdef NO_LSEEK
- if (N_GETMAGIC(x) == ZMAGIC && read(io, (char *)addr, 0x400) == -1)
+ if (N_GETMAGIC(x) == ZMAGIC && read(io, (char *)addr,
+ (0x400 - sizeof(x))) == -1)
#else
if (N_GETMAGIC(x) == ZMAGIC && lseek(io, 0x400, SEEK_SET) == -1)
#endif