diff options
| author | 1997-01-18 03:28:50 +0000 | |
|---|---|---|
| committer | 1997-01-18 03:28:50 +0000 | |
| commit | 24c7227b264f60180a5ada1819797241fc3299c4 (patch) | |
| tree | 0f5585295b167249f1cca06381e7e91733739dd3 /sys/lib/libsa/exec.c | |
| parent | Ensure libsa and libkern get compiled with -Dhp300 (diff) | |
| download | wireguard-openbsd-24c7227b264f60180a5ada1819797241fc3299c4.tar.xz wireguard-openbsd-24c7227b264f60180a5ada1819797241fc3299c4.zip | |
Gross hack for hp300, and a fix for NO_LSEEK as pointed out by briggs.
Diffstat (limited to 'sys/lib/libsa/exec.c')
| -rw-r--r-- | sys/lib/libsa/exec.c | 11 |
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 |
