update for ecoff header changes. Most changes taken from PR 2413,

submitted by Jason Thorpe.
This commit is contained in:
cgd 1996-05-16 20:49:20 +00:00
parent 50e92fd71d
commit 85b3fc5c34
1 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: nlist.c,v 1.6 1995/09/29 04:19:59 cgd Exp $ */ /* $NetBSD: nlist.c,v 1.7 1996/05/16 20:49:20 cgd Exp $ */
/* /*
* Copyright (c) 1989, 1993 * Copyright (c) 1989, 1993
@ -37,7 +37,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)nlist.c 8.1 (Berkeley) 6/4/93";
#else #else
static char rcsid[] = "$NetBSD: nlist.c,v 1.6 1995/09/29 04:19:59 cgd Exp $"; static char rcsid[] = "$NetBSD: nlist.c,v 1.7 1996/05/16 20:49:20 cgd Exp $";
#endif #endif
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
@ -180,7 +180,7 @@ __fdnlist(fd, list)
register struct nlist *list; register struct nlist *list;
{ {
struct nlist *p; struct nlist *p;
struct ecoff_filehdr *filehdrp; struct ecoff_exechdr *exechdrp;
struct ecoff_symhdr *symhdrp; struct ecoff_symhdr *symhdrp;
struct ecoff_extsym *esyms; struct ecoff_extsym *esyms;
struct stat st; struct stat st;
@ -204,26 +204,26 @@ __fdnlist(fd, list)
if (mappedfile == (char *)-1) if (mappedfile == (char *)-1)
BAD; BAD;
if (check(0, sizeof *filehdrp)) if (check(0, sizeof *exechdrp))
BADUNMAP; BADUNMAP;
filehdrp = (struct ecoff_filehdr *)&mappedfile[0]; exechdrp = (struct ecoff_exechdr *)&mappedfile[0];
if (ECOFF_BADMAG(filehdrp)) if (ECOFF_BADMAG(exechdrp))
BADUNMAP; BADUNMAP;
symhdroff = filehdrp->ef_symptr; symhdroff = exechdrp->f.f_symptr;
symhdrsize = filehdrp->ef_syms; symhdrsize = exechdrp->f.f_nsyms;
if (check(symhdroff, sizeof *symhdrp) || if (check(symhdroff, sizeof *symhdrp) ||
sizeof *symhdrp != symhdrsize) sizeof *symhdrp != symhdrsize)
BADUNMAP; BADUNMAP;
symhdrp = (struct ecoff_symhdr *)&mappedfile[symhdroff]; symhdrp = (struct ecoff_symhdr *)&mappedfile[symhdroff];
nesyms = symhdrp->sh_esymmax; nesyms = symhdrp->esymMax;
if (check(symhdrp->sh_esymoff, nesyms * sizeof *esyms)) if (check(symhdrp->cbExtOffset, nesyms * sizeof *esyms))
BADUNMAP; BADUNMAP;
esyms = (struct ecoff_extsym *)&mappedfile[symhdrp->sh_esymoff]; esyms = (struct ecoff_extsym *)&mappedfile[symhdrp->cbExtOffset];
extstroff = symhdrp->sh_estroff; extstroff = symhdrp->cbSsExtOffset;
/* /*
* clean out any left-over information for all valid entries. * clean out any left-over information for all valid entries.