NetBSD Problem Report #8502

Received: (qmail 25601 invoked from network); 28 Sep 1999 02:45:22 -0000
Message-Id: <19990928024512.27930.qmail@primenet.com.au>
Date: 28 Sep 1999 12:45:12 +1000
From: mason@primenet.com.au
Reply-To: mason@primenet.com.au
To: gnats-bugs@gnats.netbsd.org
Subject: GNU binutils/nm --size-sort broken
X-Send-Pr-Version: 3.95

>Number:         8502
>Category:       toolchain
>Synopsis:       nm --size-sort finds wrong size for some entries
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kristerw
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 27 19:50:01 +0000 1999
>Closed-Date:    Tue Dec 16 02:21:12 +0000 2003
>Last-Modified:  Tue Dec 16 02:21:12 +0000 2003
>Originator:     Geoff C. Wing
>Release:        19990926
>Organization:
Geoff Wing : <gcw@pobox.com>     Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@rxvt.org>      Ego URL : http://pobox.com/~gcw/
Zsh Stuff  : <gcw@zsh.org>       Phone   : (Australia) 0413 431 874
>Environment:
System: NetBSD c.primenet.com.au 1.4K NetBSD 1.4K (C) #0: Mon Sep 20 17:21:41 EST 1999 open@rubicon.stables.primenet.com.au:/usr/netbsd/src/sys/arch/i386/compile/C i386


>Description:
	nm --size-sort sometimes calculates the size of some entries
	incorrectly and then uses the incorrect value in the sorting.

	% nm --size-sort /usr/src/bin/pax/ar_io.o | fgrep rcsid
	00002270 t _rcsid

	We better cut down on those rcsid[] strings.  Look how much space
	they take up! :-)

>How-To-Repeat:
	An example object called screen.o:
	% nm screen.o | fgrep ' T ' | sort
	00000000 T blank_line
	00000034 T blank_screen_mem
	........
	00005528 T setPosition
	% nm --size-sort screen.o | egrep "(blank_line|setPosition)"
	00000059 T setPosition
	00005581 T blank_line
	^^^^^^^^
	This should be 00000034

>Fix:
	?
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: kristerw 
State-Changed-When: Fri Jul 20 06:59:16 PDT 2001 
State-Changed-Why:  
The code that computes the sizes does it by first sorting the symbols, 
and then computing the size as address_of_next_symbol - addess_of_symbol. 
Unfortunately, this sorting function may mix symbols from different 
sections... 
I have a patch for this, but will discuss it with the GNU people before 
comitting. 


Responsible-Changed-From-To: bin-bug-people->kristerw 
Responsible-Changed-By: kristerw 
Responsible-Changed-When: Fri Jul 20 06:59:16 PDT 2001 
Responsible-Changed-Why:  
I'll take care of it. 

From: Geoff Wing <gcw@pobox.com>
To: gnats-bugs@gnats.netbsd.org
Cc: netbsd-bugs@netbsd.org
Subject: Re: bin/8502: GNU binutils/nm --size-sort broken
Date: Tue, 8 Apr 2003 15:37:40 +1000

 This totally doesn't work for me now.  Nearly everything is wrong.
 It looks like it's sorting by offset now.

From: Geoff Wing <mason@primenet.com.au>
To: gnats-bugs@gnats.netbsd.org
Cc: netbsd-bugs@netbsd.org
Subject: Re: bin/8502: can be closed
Date: Tue, 16 Dec 2003 13:19:03 +1100

 Works OK for me with nm 2.14
State-Changed-From-To: analyzed->closed 
State-Changed-By: lukem 
State-Changed-When: Tue Dec 16 02:20:47 UTC 2003 
State-Changed-Why:  
Submitter has confirmed that the PR can be closed 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.