From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3109 invoked by alias); 19 May 2007 17:39:51 -0000 Received: (qmail 3100 invoked by uid 22791); 19 May 2007 17:39:50 -0000 X-Spam-Check-By: sourceware.org Received: from ug-out-1314.google.com (HELO ug-out-1314.google.com) (66.249.92.169) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 19 May 2007 17:39:48 +0000 Received: by ug-out-1314.google.com with SMTP id 75so631454ugb for ; Sat, 19 May 2007 10:39:46 -0700 (PDT) Received: by 10.67.106.3 with SMTP id i3mr1978772ugm.1179596385768; Sat, 19 May 2007 10:39:45 -0700 (PDT) Received: from ?88.210.73.32? ( [88.210.73.32]) by mx.google.com with ESMTP id s7sm4432108uge.2007.05.19.10.39.41; Sat, 19 May 2007 10:39:43 -0700 (PDT) Message-ID: <464F3656.9090604@portugalmail.pt> Date: Sat, 19 May 2007 17:39:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; pt-BR; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.4.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: Re: [rfc / remote protocol] ELF segment based qOffsets References: <20070509191215.GA14410@caradoc.them.org> In-Reply-To: <20070509191215.GA14410@caradoc.them.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-05/txt/msg00317.txt.bz2 (Should have sent to gdb-patches only in the first place, since this is discussing the patch itself. Sorry.) Hi Daniel, Daniel Jacobowitz wrote: > Index: gdb/elfread.c > =================================================================== > --- gdb/elfread.c.orig 2007-05-09 11:30:07.000000000 -0400 > +++ gdb/elfread.c 2007-05-09 11:30:13.000000000 -0400 > @@ -26,6 +26,8 @@ > +/* Locate the segments in ABFD. */ > + > +static struct symfile_segment_data * > +elf_symfile_segments (bfd *abfd) > +{ > + Elf_Internal_Phdr *phdrs, **segments; > + long phdrs_size; > + int num_phdrs, num_segments, num_sections, i; > + asection *sect; > + struct symfile_segment_data *data; > + > + phdrs_size = bfd_get_elf_phdr_upper_bound (abfd); > + if (phdrs_size == -1) > + return NULL; > + > + phdrs = alloca (phdrs_size); > + num_phdrs = bfd_get_elf_phdrs (abfd, phdrs); > + if (num_phdrs == -1) > + return NULL; This introduces a dependency on bfd/elf.o (bfd_get_elf_phdr_upper_bound, bfd_get_elf_phdrs) for every non elf target. See below for build log for arm-wince-mingw32ce. I don't see where in the bfd configury, but Cygwin already includes elf.o, I guess for core dump file support only, so we don't see the problem there. One way to fix it would be to patch bfd/configure.in to always include $elf in the target backend files ($tb). Or perhaps elf_symfile_segments should be moved elsewhere? Cheers, Pedro Alves -- >(cd ../gdb; make) rm -f gdb.exe gcc -g3 -O0 \ -o gdb.exe gdb.o libgdb.a \ ../readline/libreadline.a ../opcodes/libopcodes.a ../bfd/libb fd.a -lintl ../libiberty/libiberty.a -lncurses -lm -liconv -lexpat ../libibe rty/libiberty.a -luser32 libgdb.a(elfread.o): In function `elf_symfile_segments': /cygdrive/d/cegccsf/cegcc/cegcc/src/build-gdb_server/gdb/../../gdb-server_submit /src/gdb/elfread.c:67: undefined reference to `_bfd_get_elf_phdr_upper_bound' /cygdrive/d/cegccsf/cegcc/cegcc/src/build-gdb_server/gdb/../../gdb-server_submit /src/gdb/elfread.c:72: undefined reference to `_bfd_get_elf_phdrs' Info: resolving _LINES by linking to __imp__LINES (auto-import) Info: resolving _COLS by linking to __imp__COLS (auto-import) Info: resolving _stdscr by linking to __imp__stdscr (auto-import) Info: resolving _curscr by linking to __imp__curscr (auto-import) collect2: ld returned 1 exit status make: *** [gdb.exe] Error 1