From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7747 invoked by alias); 22 Apr 2004 08:07:54 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 7740 invoked from network); 22 Apr 2004 08:07:53 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 22 Apr 2004 08:07:53 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i3M87qFe007402 for ; Thu, 22 Apr 2004 04:07:52 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i3M87op01834; Thu, 22 Apr 2004 04:07:51 -0400 To: Roland McGrath Cc: Randolph Chung , Joel Brobecker , gdb@sources.redhat.com Subject: Re: add-symbol-file-from-memory patch breaks non-elf targets? References: <200404210709.i3L795Cx002971@magilla.sf.frob.com> From: Jim Blandy Date: Thu, 22 Apr 2004 13:30:00 -0000 In-Reply-To: <200404210709.i3L795Cx002971@magilla.sf.frob.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-04/txt/msg00130.txt.bz2 Roland McGrath writes: > In gdb, I could not find, and still cannot find, a reasonable way to > conditionalize something at compile time on "will there be ELF". Hence the > runtime check for bfd_target_elf_flavour, and the unconditional link-time > reference to bfd_elf_bfd_from_remote_memory. AFAICT, elfread.c is always > built into gdb even for non-ELF targets, as a further example telling me > there really is no good way to conditionalize this correctly. It happens > not to use any bfd_elf_* interfaces and so links ok and is just dead code > in ELFless configurations. > > I am open to suggestions. I remember this coming up now; I wish I had remembered it before I approved the patch. I messed around with it, and I couldn't find a good place either. How about creating a new file, elf-tdep.c, putting the code there, and having linux.mt add elf-tdep.o to the link?