Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro_alves@portugalmail.pt>
To: gdb-patches@sourceware.org
Subject: Re: [rfc / remote protocol] ELF segment based qOffsets
Date: Sat, 19 May 2007 17:39:00 -0000	[thread overview]
Message-ID: <464F3656.9090604@portugalmail.pt> (raw)
In-Reply-To: <20070509191215.GA14410@caradoc.them.org>

(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






  parent reply	other threads:[~2007-05-19 17:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-09 19:12 Daniel Jacobowitz
2007-05-09 19:47 ` Eli Zaretskii
2007-05-19 17:39 ` Pedro Alves [this message]
2007-06-18 15:48 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=464F3656.9090604@portugalmail.pt \
    --to=pedro_alves@portugalmail.pt \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox