From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13142 invoked by alias); 26 Jun 2002 19:57:47 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 13132 invoked from network); 26 Jun 2002 19:57:45 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 26 Jun 2002 19:57:45 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 2D61C5EA11; Wed, 26 Jun 2002 14:57:44 -0500 (EST) To: Hilfinger@otisco.mckusick.com Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: don't read coff line number unless we have symbols too References: <200206241932.MAA19971@otisco.McKusick.COM> From: Jim Blandy Date: Wed, 26 Jun 2002 12:57:00 -0000 In-Reply-To: <200206241932.MAA19971@otisco.McKusick.COM> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-06/txt/msg00546.txt.bz2 "Paul N. Hilfinger" writes: > Jim Blandy wrote : > > > > Ping to the COFF maintainer: this patch needs review. > > > > Jim Blandy writes: > > > > > 2002-03-06 Jim Blandy > > > > > > * coffread.c (coff_symfile_read): Don't try to read the line > > > number table from disk if the image file doesn't have a symbol > > > table; we'll never actually look at the info anyway, and Windows > > > ships DLL's with bogus file offsets for the line number data. > > But apparently, on Interix, you can get files with valid line numbers and > no symbols when all the .o's come from VC and are linked by ld. So the > line-number info is perhaps not entirely useless. Is this change a > space-saving move, or a fix for a more serious problem? See the comment from the patch: ! /* Only read line number information if we have symbols. ! ! On Windows NT, some of the system's DLL's have sections with ! PointerToLinenumbers fields that are non-zero, but point at ! random places within the image file. (In the case I found, ! KERNEL32.DLL's .text section has a line number info pointer that ! points into the middle of the string `lib\\i386\kernel32.dll'.) ! ! However, these DLL's also have no symbols. The line number ! tables are meaningless without symbols. And in fact, GDB never ! uses the line number information unless there are symbols. So we ! can avoid spurious error messages (and maybe run a little ! faster!) by not even reading the line number table unless we have ! symbols. */