From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24261 invoked by alias); 18 Apr 2002 18:49:29 -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 24249 invoked from network); 18 Apr 2002 18:49:27 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 18 Apr 2002 18:49:27 -0000 Received: from romulus.sfbay.redhat.com (romulus.sfbay.redhat.com [172.16.27.251]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id LAA01200; Thu, 18 Apr 2002 11:49:25 -0700 (PDT) Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g3IInJh08475; Thu, 18 Apr 2002 11:49:19 -0700 Date: Thu, 18 Apr 2002 11:49:00 -0000 From: Kevin Buettner Message-Id: <1020418184919.ZM8474@localhost.localdomain> In-Reply-To: Michael Snyder "Re: [PATCH] cvexpr.c: Don't let linker delete unused globals" (Apr 18, 10:02am) References: <1020418132243.ZM6877@localhost.localdomain> <3CBEFC1F.3F0B6D1D@redhat.com> To: Michael Snyder , Kevin Buettner Subject: Re: [PATCH] cvexpr.c: Don't let linker delete unused globals Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-04/txt/msg00603.txt.bz2 On Apr 18, 10:02am, Michael Snyder wrote: > > On AIX, I was seeing lots of failures in gdb.base/code-expr.exp and > > gdb.base/cvexpr.exp due to the fact that the linker deletes unused > > symbols. The patch below fixes these failures. > > > > Committed as obvious. > > Wow, that's really sad, to have to add all that code > for such a trivial reason. I'm sure there are other > tests in gdb.base that also make use of symbols that > don't get called. Yeah. I ran across some of these in the past and added some similar looking code. E.g, here's a ChangeLog entry for one of them: 2000-03-21 Kevin Buettner * gdb.base/pointers.c (usevar): New function. (main): Make sure that global variables v_int_pointer2, rptr, and y are all referenced someplace in the program by calling usevar() on them. [Some linkers delete symbols which are never referenced. The space remains, but there's no way to get a (symbolic) handle on the variable from the debugger.] > Isn't there some option that you can > give to the linker to tell it not to remove these? Apparently there is, but in my opinion, it's easier to maintain changes to C code than bits of configury involving the linker which can change over time. Also, the testsuite will just work without the need to specify any additional linker options for other (future) linkers which choose to also garbage collect unused symbols. Kevin