NetBSD Problem Report #2413

From gnats  Tue May 14 17:49:47 1996
Received: from nostromo.nas.nasa.gov by pain.lcs.mit.edu (8.7.4/8.6.12) with ESMTP id RAA14850 for <gnats-bugs@gnats.netbsd.org>; Tue, 14 May 1996 17:33:05 -0400 (EDT)
Message-Id: <199605142134.OAA18682@nostromo.nas.nasa.gov>
Date: Tue, 14 May 1996 14:34:17 -0700 (PDT)
From: Jason Thorpe <thorpej@nas.nasa.gov>
Reply-To: thorpej@nas.nasa.gov
To: gnats-bugs@gnats.netbsd.org
Subject: Bogons left from ecoff header changes
X-Send-Pr-Version: 3.95

>Number:         2413
>Category:       port-alpha
>Synopsis:       Bogons left from ecoff header changes
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    gnats-admin
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 14 17:50:04 +0000 1996
>Closed-Date:    Thu May 16 20:49:48 +0000 1996
>Last-Modified:  Thu May 16 20:50:35 +0000 1996
>Originator:     Jason Thorpe
>Release:        NetBSD 1.1B, May 13th, 1996
>Organization:
Numerical Aerodynamic Simulation Project - NASA Ames
>Environment:

System: NetBSD nostromo 1.1B NetBSD 1.1B (NOSY) #9: Tue May 7 19:08:07 PDT 1996 thorpej@nostromo:/work/netbsd/src/sys/arch/alpha/compile/NOSY alpha


>Description:

	There appear to be a couple of mistakes in the recent ecoff
	header changes, and it appears that the C library nlist functions
	were not updated.

>How-To-Repeat:

	Try to compile a NetBSD/alpha C library.

>Fix:

	The diffs below fix a broken macro in alpha/include/ecoff.h
	and update the C library nlist functions to the new ecoff
	structure member names.

Index: lib/libc/gen/nlist.c
===================================================================
RCS file: /mastersrc/netbsd/src/lib/libc/gen/nlist.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 nlist.c
*** nlist.c	1995/12/27 23:45:40	1.1.1.1
--- nlist.c	1996/05/14 21:28:27
***************
*** 211,229 ****
  	if (ECOFF_BADMAG(filehdrp))
  		BADUNMAP;

! 	symhdroff = filehdrp->ef_symptr;
! 	symhdrsize = filehdrp->ef_syms;

  	if (check(symhdroff, sizeof *symhdrp) ||
  	    sizeof *symhdrp != symhdrsize)
  		BADUNMAP;
  	symhdrp = (struct ecoff_symhdr *)&mappedfile[symhdroff];

! 	nesyms = symhdrp->sh_esymmax;
! 	if (check(symhdrp->sh_esymoff, nesyms * sizeof *esyms))
  		BADUNMAP;
! 	esyms = (struct ecoff_extsym *)&mappedfile[symhdrp->sh_esymoff];
! 	extstroff = symhdrp->sh_estroff;

  	/*
  	 * clean out any left-over information for all valid entries.
--- 211,229 ----
  	if (ECOFF_BADMAG(filehdrp))
  		BADUNMAP;

! 	symhdroff = filehdrp->f_symptr;
! 	symhdrsize = filehdrp->f_nsyms;

  	if (check(symhdroff, sizeof *symhdrp) ||
  	    sizeof *symhdrp != symhdrsize)
  		BADUNMAP;
  	symhdrp = (struct ecoff_symhdr *)&mappedfile[symhdroff];

! 	nesyms = symhdrp->esymMax;
! 	if (check(symhdrp->cbExtOffset, nesyms * sizeof *esyms))
  		BADUNMAP;
! 	esyms = (struct ecoff_extsym *)&mappedfile[symhdrp->cbExtOffset];
! 	extstroff = symhdrp->cbSsExtOffset;

  	/*
  	 * clean out any left-over information for all valid entries.
Index: sys/arch/alpha/include/ecoff.h
===================================================================
RCS file: /mastersrc/netbsd/src/sys/arch/alpha/include/ecoff.h,v
retrieving revision 1.1.1.2
diff -c -r1.1.1.2 ecoff.h
*** ecoff.h	1996/05/13 03:57:01	1.1.1.2
--- ecoff.h	1996/05/14 21:18:48
***************
*** 44,55 ****
  #define ECOFF_MAGIC_ALPHA		0603
  #define ECOFF_MAGIC_NETBSD_ALPHA	0605
  #define ECOFF_BADMAG(ep)						\
! 	((ep)->f.f_magic != ECOFF_MAGIC_ALPHA &&			\
! 	    (ep)->f.f_magic != ECOFF_MAGIC_NETBSD_ALPHA)

  #define ECOFF_FLAG_EXEC			0002
  #define ECOFF_SEGMENT_ALIGNMENT(ep) \
!     (((ep)->f.f_flags & ECOFF_FLAG_EXEC) == 0 ? 8 : 16)

  struct ecoff_symhdr {
  	int16_t		magic;
--- 44,55 ----
  #define ECOFF_MAGIC_ALPHA		0603
  #define ECOFF_MAGIC_NETBSD_ALPHA	0605
  #define ECOFF_BADMAG(ep)						\
! 	((ep)->f_magic != ECOFF_MAGIC_ALPHA &&				\
! 	    (ep)->f_magic != ECOFF_MAGIC_NETBSD_ALPHA)

  #define ECOFF_FLAG_EXEC			0002
  #define ECOFF_SEGMENT_ALIGNMENT(ep) \
!     (((ep)->f_flags & ECOFF_FLAG_EXEC) == 0 ? 8 : 16)

  struct ecoff_symhdr {
  	int16_t		magic;
>Release-Note:
>Audit-Trail:

From: Chris G Demetriou <Chris_G_Demetriou@UX2.SP.CS.CMU.EDU>
To: thorpej@nas.nasa.gov
Cc: gnats-bugs@NetBSD.ORG
Subject: Re: port-alpha/2413: Bogons left from ecoff header changes 
Date: Thu, 16 May 1996 12:26:12 -0400

 > >Fix:
 > 
 > 	The diffs below fix a broken macro in alpha/include/ecoff.h
 > 	and update the C library nlist functions to the new ecoff
 > 	structure member names.

 No, those diffs break a correct macro in alpha/include/ecoff.h, and
 don't properly fix the C library nlist functions.

 The alpha/include/ecoff.h macros are correct as is.


 cgd
State-Changed-From-To: open->closed 
State-Changed-By: cgd 
State-Changed-When: Thu May 16 16:49:48 EDT 1996 
State-Changed-Why:  
fixed properly. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.