From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15551 invoked by alias); 2 Jul 2008 17:45:40 -0000 Received: (qmail 15533 invoked by uid 22791); 2 Jul 2008 17:45:39 -0000 X-Spam-Check-By: sourceware.org Received: from bluesmobile.specifix.com (HELO bluesmobile.specifix.com) (216.129.118.140) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 02 Jul 2008 17:44:52 +0000 Received: from [127.0.0.1] (bluesmobile.specifix.com [216.129.118.140]) by bluesmobile.specifix.com (Postfix) with ESMTP id F26963C1D1; Wed, 2 Jul 2008 10:44:50 -0700 (PDT) Subject: Re: Bug handling zero sized symbols in minsyms.c From: Michael Snyder To: Robert Norton Cc: gdb@sourceware.org In-Reply-To: References: Content-Type: text/plain Date: Wed, 02 Jul 2008 17:45:00 -0000 Message-Id: <1215020690.3601.1592.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-7.fc7) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-07/txt/msg00015.txt.bz2 On Wed, 2008-07-02 at 09:58 -0700, Robert Norton wrote: > Hi, > > In minsyms.c:lookup_minimal_symbol_by_pc_section() there is some code > which attempts to prefer symbols with sizes over those with zero size. > This is quite useful[1]. Unfortunately the present code will only work > if there is at most one zero-sized symbol. The fix is around line 503: > > if (MSYMBOL_SIZE (&msymbol[hi]) == 0 > && best_zero_sized == -1) > { > best_zero_sized = hi; > hi--; > continue; > } > > SHOULD be: > > if (MSYMBOL_SIZE (&msymbol[hi]) == 0) > { > if (best_zero_sized == -1) > best_zero_sized = hi; > hi--; > continue; > } > > We keep the highest zero-sized symbol as the best but continue to > iterate backwards until we hit a non-zero-sized symbol or run out of > symbols. It's pretty clear that this is what was originally intended. Your change is good, thanks. > I can get copyright assigment for this if required although it seems > pretty trivial... Not necessary, but feel free to if you'd like. I think this is at least the second change you've submitted. Could you give us a change log entry please?