Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: "Ananth Sowda" <asowda@gmail.com>
To: "Ananth Sowda" <asowda@gmail.com>, gdb@sourceware.org
Subject: Re: DSO with relocations and GDB.
Date: Tue, 22 Apr 2008 20:09:00 -0000	[thread overview]
Message-ID: <c92b40c80804211626x16d33321q7f498a6eb49809da@mail.gmail.com> (raw)
In-Reply-To: <20080421183241.GA19774@caradoc.them.org>

> > BFD internal section data structure for .debug_info section is not
> > marked with SEC_RELOC in flags and number of relocation records for
> > the section is 0.  objdump -h output shows that sh_link(points to
> > .symtab) and sh_link(points to .debug_info) are set correctly for the
> > .rela_debug.info section.
>
> That's the real problem; you may want to ask the binutils list
> or debug how with sh_link/sh_info set there is still no SEC_RELOC
> flag.
>
> --
> Daniel Jacobowitz
> CodeSourcery
>
Thanks for your suggestion.  One correction and further observation follows:
 sh_info points to .debug_info  and sh_link is pointing to .dynsym,
not .symtab. This is expected outcome in a ET_DYN file.

However, the bfd/elf.c code shown below does not handle relocations
using .dynsym.

/* If this reloc section does not use the main symbol table we
           don't treat it as a reloc section.  BFD can't adequately
           represent such a section, so at least for now, we don't
           try.  We just present it as a normal section.  We also
           can't use it as a reloc section if it points to the null
           section, an invalid section, or another reloc section.  */
        if (hdr->sh_link != elf_onesymtab (abfd)
            || hdr->sh_info == SHN_UNDEF
            || (hdr->sh_info >= SHN_LORESERVE && hdr->sh_info <= SHN_HIRESERVE)
            || hdr->sh_info >= num_sec
            || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_REL
            || elf_elfsections (abfd)[hdr->sh_info]->sh_type == SHT_RELA)
          return _bfd_elf_make_section_from_shdr (abfd, hdr, name,
                                                  shindex);


  reply	other threads:[~2008-04-21 23:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-20  2:39 Ananth Sowda
2008-04-20  9:09 ` Daniel Jacobowitz
2008-04-21 23:26   ` Ananth Sowda
2008-04-21 23:34     ` Daniel Jacobowitz
2008-04-22 20:09       ` Ananth Sowda [this message]
2008-04-23  7:28         ` 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=c92b40c80804211626x16d33321q7f498a6eb49809da@mail.gmail.com \
    --to=asowda@gmail.com \
    --cc=gdb@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